home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-ospf-version2-00.txt < prev    next >
Text File  |  1993-03-03  |  523KB  |  11,706 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                                             J. Moy
  6. Internet Draft                                             Proteon, Inc.
  7. Expiration Date: April 1993                                November 1992
  8.  
  9.  
  10.                              OSPF Version 2
  11.  
  12.  
  13.  
  14. Status of this Memo
  15.  
  16.     This document is an Internet Draft.   Internet  Drafts  are  working
  17.     documents  of the Internet Engineering Task Force (IETF), its Areas,
  18.     and its Working Groups.  Note that other groups may also  distribute
  19.     working documents as Internet Drafts.
  20.  
  21.     Internet Drafts are draft documents  valid  for  a  maximum  of  six
  22.     months.   Internet  Drafts may be updated, replaced, or obsoleted by
  23.     other documents at any time.  It is not appropriate to use  Internet
  24.     Drafts  as reference material or to cite them other than as a "work-
  25.     ing draft" or "work in progress." Please check the 1id-abstracts.txt
  26.     listing  contained  in  the  internet-drafts  Shadow  Directories on
  27.     nic.ddn.mil,  nnsc.nsf.net,  nic.nordu.net,   ftp.nisc.sri.com,   or
  28.     munnari.oz.au to learn the current status of any Internet Draft.
  29.  
  30. Abstract
  31.  
  32.     This memo documents version 2 of  the  OSPF  protocol.   OSPF  is  a
  33.     link-state  based routing protocol.  It is designed to be run inter-
  34.     nal to a single Autonomous System.  Each OSPF  router  maintains  an
  35.     identical  database  describing  the  Autonomous  System's topology.
  36.     From this database, a routing table is calculated by constructing  a
  37.     shortest-path tree.
  38.  
  39.     OSPF recalculates routes quickly in the face of topological changes,
  40.     utilizing a minimum of routing protocol traffic.  OSPF provides sup-
  41.     port for equal-cost multipath.  Separate routes  can  be  calculated
  42.     for  each  IP  type  of service.  An area routing capability is pro-
  43.     vided, enabling an additional level  of  routing  protection  and  a
  44.     reduction  in routing protocol traffic.  In addition, all OSPF rout-
  45.     ing protocol exchanges are authenticated.
  46.  
  47.     OSPF Version 2 was originally documented in RFC  1247.  The  differ-
  48.     ences  between  RFC  1247 and this memo are explained in Appendix E.
  49.     The differences consist of bug fixes  and  clarifications,  and  are
  50.     backward-compatible  in  nature.  Implementations of RFC 1247 and of
  51.     this memo will interoperate.
  52.  
  53.  
  54.  
  55.  
  56. [Moy]                                                           [Page 1]
  57.  
  58. Internet Draft               OSPF Version 2                November 1992
  59.  
  60.  
  61.     Please send comments to ospf@gated.cornell.edu.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. [Moy]                                                           [Page 2]
  113.  
  114. Internet Draft               OSPF Version 2                November 1992
  115.  
  116.  
  117. Table of Contents
  118.  
  119.     1       Introduction ........................................... 6
  120.     1.1     Protocol Overview ...................................... 6
  121.     1.2     Definitions of commonly used terms ..................... 7
  122.     1.3     Brief history of SPF-based routing technology ......... 10
  123.     1.4     Organization of this document ......................... 10
  124.     2       The Topological Database .............................. 11
  125.     2.1     The shortest-path tree ................................ 14
  126.     2.2     Use of external routing information ................... 17
  127.     2.3     Equal-cost multipath .................................. 21
  128.     2.4     TOS-based routing ..................................... 21
  129.     3       Splitting the AS into Areas ........................... 22
  130.     3.1     The backbone of the Autonomous System ................. 23
  131.     3.2     Inter-area routing .................................... 23
  132.     3.3     Classification of routers ............................. 24
  133.     3.4     A sample area configuration ........................... 25
  134.     3.5     IP subnetting support ................................. 30
  135.     3.6     Supporting stub areas ................................. 32
  136.     3.7     Partitions of areas ................................... 33
  137.     4       Functional Summary .................................... 34
  138.     4.1     Inter-area routing .................................... 35
  139.     4.2     AS external routes .................................... 35
  140.     4.3     Routing protocol packets .............................. 35
  141.     4.4     Basic implementation requirements ..................... 38
  142.     4.5     Optional OSPF capabilities ............................ 39
  143.     5       Protocol data structures .............................. 40
  144.     6       The Area Data Structure ............................... 42
  145.     7       Bringing Up Adjacencies ............................... 45
  146.     7.1     The Hello Protocol .................................... 45
  147.     7.2     The Synchronization of Databases ...................... 46
  148.     7.3     The Designated Router ................................. 47
  149.     7.4     The Backup Designated Router .......................... 48
  150.     7.5     The graph of adjacencies .............................. 49
  151.     8       Protocol Packet Processing ............................ 49
  152.     8.1     Sending protocol packets .............................. 50
  153.     8.2     Receiving protocol packets ............................ 52
  154.     9       The Interface Data Structure .......................... 55
  155.     9.1     Interface states ...................................... 57
  156.     9.2     Events causing interface state changes ................ 60
  157.     9.3     The Interface state machine ........................... 61
  158.     9.4     Electing the Designated Router ........................ 64
  159.     9.5     Sending Hello packets ................................. 66
  160.     9.5.1   Sending Hello packets on non-broadcast networks ....... 67
  161.     10      The Neighbor Data Structure ........................... 68
  162.     10.1    Neighbor states ....................................... 71
  163.     10.2    Events causing neighbor state changes ................. 74
  164.     10.3    The Neighbor state machine ............................ 76
  165.  
  166.  
  167.  
  168. [Moy]                                                           [Page 3]
  169.  
  170. Internet Draft               OSPF Version 2                November 1992
  171.  
  172.  
  173.     10.4    Whether to become adjacent ............................ 82
  174.     10.5    Receiving Hello packets ............................... 82
  175.     10.6    Receiving Database Description Packets ................ 84
  176.     10.7    Receiving Link State Request Packets .................. 87
  177.     10.8    Sending Database Description Packets .................. 88
  178.     10.9    Sending Link State Request Packets .................... 89
  179.     10.10   An Example ............................................ 89
  180.     11      The Routing Table Structure ........................... 91
  181.     11.1    Routing table lookup .................................. 94
  182.     11.2    Sample routing table, without areas ................... 96
  183.     11.3    Sample routing table, with areas ...................... 96
  184.     12      Link State Advertisements ............................. 99
  185.     12.1    The Link State Header ................................ 100
  186.     12.1.1  LS age ............................................... 100
  187.     12.1.2  Options .............................................. 101
  188.     12.1.3  LS type .............................................. 101
  189.     12.1.4  Link State ID ........................................ 103
  190.     12.1.5  Advertising Router ................................... 104
  191.     12.1.6  LS sequence number ................................... 104
  192.     12.1.7  LS checksum .......................................... 105
  193.     12.2    The link state database .............................. 105
  194.     12.3    Representation of TOS ................................ 106
  195.     12.4    Originating link state advertisements ................ 107
  196.     12.4.1  Router links ......................................... 110
  197.     12.4.2  Network links ........................................ 116
  198.     12.4.3  Summary links ........................................ 117
  199.     12.4.4  Originating summary links into stub areas ............ 121
  200.     12.4.5  AS external links .................................... 121
  201.     13      The Flooding Procedure ............................... 124
  202.     13.1    Determining which link state is newer ................ 127
  203.     13.2    Installing link state advertisements in the database . 128
  204.     13.3    Next step in the flooding procedure .................. 129
  205.     13.4    Receiving self-originated link state ................. 131
  206.     13.5    Sending Link State Acknowledgment packets ............ 132
  207.     13.6    Retransmitting link state advertisements ............. 134
  208.     13.7    Receiving link state acknowledgments ................. 135
  209.     14      Aging The Link State Database ........................ 135
  210.     14.1    Premature aging of advertisements .................... 136
  211.     15      Virtual Links ........................................ 137
  212.     16      Calculation Of The Routing Table ..................... 139
  213.     16.1    Calculating the shortest-path tree for an area ....... 140
  214.     16.1.1  The next hop calculation ............................. 146
  215.     16.2    Calculating the inter-area routes .................... 147
  216.     16.3    Examining transit areas' summary links ............... 148
  217.     16.4    Calculating AS external routes ....................... 150
  218.     16.5    Incremental updates --- summary links ................ 152
  219.     16.6    Incremental updates --- AS external links ............ 153
  220.     16.7    Events generated as a result of routing table changes  153
  221.  
  222.  
  223.  
  224. [Moy]                                                           [Page 4]
  225.  
  226. Internet Draft               OSPF Version 2                November 1992
  227.  
  228.  
  229.     16.8    Equal-cost multipath ................................. 154
  230.     16.9    Building the non-zero-TOS portion of the routing table 154
  231.             Footnotes ............................................ 157
  232.             References ........................................... 160
  233.     A       OSPF data formats .................................... 162
  234.     A.1     Encapsulation of OSPF packets ........................ 162
  235.     A.2     The options field .................................... 164
  236.     A.3     OSPF Packet Formats .................................. 166
  237.     A.3.1   The OSPF packet header ............................... 167
  238.     A.3.2   The Hello packet ..................................... 169
  239.     A.3.3   The Database Description packet ...................... 171
  240.     A.3.4   The Link State Request packet ........................ 173
  241.     A.3.5   The Link State Update packet ......................... 175
  242.     A.3.6   The Link State Acknowledgment packet ................. 177
  243.     A.4     Link state advertisement formats ..................... 179
  244.     A.4.1   The Link State Advertisement header .................. 180
  245.     A.4.2   Router links advertisements .......................... 182
  246.     A.4.3   Network links advertisements ......................... 186
  247.     A.4.4   Summary link advertisements .......................... 188
  248.     A.4.5   AS external link advertisements ...................... 190
  249.     B       Architectural Constants .............................. 192
  250.     C       Configurable Constants ............................... 194
  251.     C.1     Global parameters .................................... 194
  252.     C.2     Area parameters ...................................... 194
  253.     C.3     Router interface parameters .......................... 196
  254.     C.4     Virtual link parameters .............................. 198
  255.     C.5     Non-broadcast, multi-access network parameters ....... 198
  256.     C.6     Host route parameters ................................ 199
  257.     D       Authentication ....................................... 200
  258.     D.1     Autype 0 -- No authentication ........................ 200
  259.     D.2     Autype 1 -- Simple password .......................... 200
  260.     E       Differences from RFC 1247 ............................ 202
  261.     E.1     A fix for a problem with OSPF Virtual links .......... 202
  262.     E.2     Supporting supernetting and subnet 0 ................. 203
  263.     E.3     Obsoleting LSInfinity in router-LSAs ................. 204
  264.     E.4     TOS encoding updated ................................. 204
  265.     E.5     Summarizing routes into transit areas ................ 205
  266.     E.6     Summarizing routes into stub areas ................... 205
  267.     E.7     Required Statistics appendix deleted ................. 205
  268.     E.8     Other changes ........................................ 205
  269.     F.      An algorithm for assigning Link State IDs ............ 207
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280. [Moy]                                                           [Page 5]
  281.  
  282. Internet Draft               OSPF Version 2                November 1992
  283.  
  284.  
  285. 1.  Introduction
  286.  
  287.     This document is a specification of the  Open  Shortest  Path  First
  288.     (OSPF) internet routing protocol.  OSPF is classified as an Internal
  289.     Gateway Protocol (IGP).  This  means  that  it  distributes  routing
  290.     information between routers belonging to a single Autonomous System.
  291.     The OSPF protocol is based on SPF or link-state technology.  This is
  292.     a  departure  from  the Bellman-Ford base used by traditional TCP/IP
  293.     internet routing protocols.
  294.  
  295.     The OSPF protocol was developed by the OSPF  working  group  of  the
  296.     Internet Engineering Task Force.  It has been designed expressly for
  297.     the TCP/IP internet environment, including explicit support  for  IP
  298.     subnetting,  TOS-based routing and the tagging of externally-derived
  299.     routing information.  OSPF also provides for the  authentication  of
  300.     routing  updates,  and  utilizes IP multicast when sending/receiving
  301.     the updates.  In addition, much work has been done to produce a pro-
  302.     tocol  that responds quickly to topology changes, yet involves small
  303.     amounts of routing protocol traffic.
  304.  
  305.     The author would like to thank Fred Baker, Jeffrey Burgan, Rob  Col-
  306.     tun,  Dino  Farinacci,  Vince  Fuller,  Phanindra  Jujjavarapu, Milo
  307.     Medin, Kannan Varadhan and the rest of the OSPF  working  group  for
  308.     the ideas and support they have given to this project.
  309.  
  310.     1.1.  Protocol overview
  311.  
  312.         OSPF routes IP  packets  based  solely  on  the  destination  IP
  313.         address  and  IP  Type of Service found in the IP packet header.
  314.         IP packets are routed "as is" -- they are  not  encapsulated  in
  315.         any further protocol headers as they transit the Autonomous Sys-
  316.         tem.  OSPF is a dynamic routing protocol.   It  quickly  detects
  317.         topological   changes  in  the  AS  (such  as  router  interface
  318.         failures) and calculates new loop-free routes after a period  of
  319.         convergence.  This period of convergence is short and involves a
  320.         minimum of routing traffic.
  321.  
  322.         In an SPF-based routing protocol, each router maintains a  data-
  323.         base describing the Autonomous System's topology.  Each partici-
  324.         pating router has an identical database.  Each individual  piece
  325.         of this database is a particular router's local state (e.g., the
  326.         router's usable interfaces and reachable neighbors).  The router
  327.         distributes  its local state throughout the Autonomous System by
  328.         flooding.
  329.  
  330.         All routers run the exact same algorithm, in parallel.  From the
  331.         topological  database, each router constructs a tree of shortest
  332.         paths with itself as root.  This shortest-path  tree  gives  the
  333.  
  334.  
  335.  
  336. [Moy]                                                           [Page 6]
  337.  
  338. Internet Draft               OSPF Version 2                November 1992
  339.  
  340.  
  341.         route  to each destination in the Autonomous System.  Externally
  342.         derived routing information appears on the tree as leaves.
  343.  
  344.         OSPF calculates separate routes for each Type of Service  (TOS).
  345.         When  several  equal-cost routes to a destination exist, traffic
  346.         is distributed equally among them.   The  cost  of  a  route  is
  347.         described by a single dimensionless metric.
  348.  
  349.         OSPF allows sets of networks to be  grouped  together.   Such  a
  350.         grouping  is  called an area.  The topology of an area is hidden
  351.         from the rest of the Autonomous System.  This information hiding
  352.         enables a significant reduction in routing traffic.  Also, rout-
  353.         ing within the area is determined only by the area's own  topol-
  354.         ogy, lending the area protection from bad routing data.  An area
  355.         is a generalization of an IP subnetted network.
  356.  
  357.         OSPF enables the flexible configuration  of  IP  subnets.   Each
  358.         route  distributed by OSPF has a destination and mask.  Two dif-
  359.         ferent subnets of the same IP network number may have  different
  360.         sizes  (i.e., different masks).  This is commonly referred to as
  361.         variable length subnets.  A packet is routed to the best  (i.e.,
  362.         longest  or most specific) match.  Host routes are considered to
  363.         be subnets whose masks are "all ones" (0xffffffff).
  364.  
  365.         All OSPF protocol exchanges are authenticated.  This means  that
  366.         only  trusted routers can participate in the Autonomous System's
  367.         routing.  A variety of authentication schemes  can  be  used;  a
  368.         single  authentication scheme is configured for each area.  This
  369.         enables some areas to use much stricter authentication than oth-
  370.         ers.
  371.  
  372.         Externally derived routing data (e.g., routes learned  from  the
  373.         Exterior   Gateway   Protocol  (EGP))  is  passed  transparently
  374.         throughout the Autonomous System.  This externally derived  data
  375.         is kept separate from the OSPF protocol's link state data.  Each
  376.         external route can also be tagged  by  the  advertising  router,
  377.         enabling  the  passing of additional information between routers
  378.         on the boundaries of the Autonomous System.
  379.  
  380.  
  381.     1.2.  Definitions of commonly used terms
  382.  
  383.         Here is a collection  of  definitions  for  terms  that  have  a
  384.         specific  meaning  to  the protocol and that are used throughout
  385.         the text.  The reader  unfamiliar  with  the  Internet  Protocol
  386.         Suite is referred to [RS-85-153] for an introduction to IP.
  387.  
  388.  
  389.  
  390.  
  391.  
  392. [Moy]                                                           [Page 7]
  393.  
  394. Internet Draft               OSPF Version 2                November 1992
  395.  
  396.  
  397.         Router
  398.             A level three Internet  Protocol  packet  switch.   Formerly
  399.             called a gateway in much of the IP literature.
  400.  
  401.         Autonomous System
  402.             A group of routers exchanging routing information via a com-
  403.             mon routing protocol.  Abbreviated as AS.
  404.  
  405.         Internal Gateway Protocol
  406.             The routing protocol spoken by the routers belonging  to  an
  407.             Autonomous  system.   Abbreviated  as  IGP.  Each Autonomous
  408.             System has a single IGP.  Different Autonomous  Systems  may
  409.             be running different IGPs.
  410.  
  411.         Router ID
  412.             A 32-bit number assigned to each  router  running  the  OSPF
  413.             protocol.  This number uniquely identifies the router within
  414.             an Autonomous System.
  415.  
  416.         Network
  417.             In this paper, an IP network or subnet.  It is possible  for
  418.             one   physical   network   to   be   assigned   multiple  IP
  419.             network/subnet numbers.  We consider these  to  be  separate
  420.             networks.  Point-to-point physical networks are an exception
  421.             - they are considered a single network no  matter  how  many
  422.             (if  any  at  all) IP network/subnet numbers are assigned to
  423.             them.
  424.  
  425.         Network mask
  426.             A 32-bit number indicating the range of IP addresses  resid-
  427.             ing  on  a  single  IP  network/subnet.   This specification
  428.             displays network masks as hexadecimal numbers.  For example,
  429.             the  network  mask  for a class C IP network is displayed as
  430.             0xffffff00.  Such a mask is often displayed elsewhere in the
  431.             literature as 255.255.255.0.
  432.  
  433.         Multi-access networks
  434.             Those physical networks that support the attachment of  mul-
  435.             tiple (more than two) routers.  Each pair of routers on such
  436.             a network is assumed to  be  able  to  communicate  directly
  437.             (e.g., multi-drop networks are excluded).
  438.  
  439.         Interface
  440.             The connection between a router and one of its attached net-
  441.             works.   An  interface has state information associated with
  442.             it, which is obtained from the underlying lower level proto-
  443.             cols  and  the  routing  protocol itself.  An interface to a
  444.             network has associated with it a single IP address and  mask
  445.  
  446.  
  447.  
  448. [Moy]                                                           [Page 8]
  449.  
  450. Internet Draft               OSPF Version 2                November 1992
  451.  
  452.  
  453.             (unless  the  network  is  an unnumbered point-to-point net-
  454.             work).  An interface is sometimes  also  referred  to  as  a
  455.             link.
  456.  
  457.         Neighboring routers
  458.             Two routers that have interfaces to a  common  network.   On
  459.             multi-access  networks, neighbors are dynamically discovered
  460.             by OSPF's Hello Protocol.
  461.  
  462.         Adjacency
  463.             A relationship formed between selected  neighboring  routers
  464.             for  the  purpose  of  exchanging  routing information.  Not
  465.             every pair of neighboring routers become adjacent.
  466.  
  467.         Link state advertisement
  468.             Describes to the local state of a router or  network.   This
  469.             includes  the  state of the router's interfaces and adjacen-
  470.             cies.  Each link state advertisement is  flooded  throughout
  471.             the routing domain.  The collected link state advertisements
  472.             of all routers and networks forms the protocol's topological
  473.             database.
  474.  
  475.         Hello protocol
  476.             The part of the OSPF protocol used to establish and maintain
  477.             neighbor  relationships.  On multi-access networks the Hello
  478.             protocol can also dynamically discover neighboring routers.
  479.  
  480.         Designated Router
  481.             Each multi-access network that has  at  least  two  attached
  482.             routers has a Designated Router.  The Designated Router gen-
  483.             erates a link state advertisement for the multi-access  net-
  484.             work  and  has other special responsibilities in the running
  485.             of the protocol.  The Designated Router is  elected  by  the
  486.             Hello Protocol.
  487.  
  488.             The Designated Router concept enables  a  reduction  in  the
  489.             number  of  adjacencies  required on a multi-access network.
  490.             This in turn reduces the amount of routing protocol  traffic
  491.             and the size of the topological database.
  492.  
  493.         Lower-level protocols
  494.             The underlying network access protocols  that  provide  ser-
  495.             vices  to  the Internet Protocol and in turn the OSPF proto-
  496.             col.  Examples of these are the X.25 packet and frame levels
  497.             for PDNs, and the ethernet data link layer for ethernets.
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504. [Moy]                                                           [Page 9]
  505.  
  506. Internet Draft               OSPF Version 2                November 1992
  507.  
  508.  
  509.     1.3.  Brief history of SPF-based routing technology
  510.  
  511.         OSPF is an SPF-based routing protocol.  Such protocols are  also
  512.         referred  to  in  the  literature  as link-state or distributed-
  513.         database protocols.  This section gives a brief  description  of
  514.         the  developments  in  SPF-based technology that have influenced
  515.         the OSPF protocol.
  516.  
  517.         The first SPF-based routing protocol was developed  for  use  in
  518.         the   ARPANET   packet  switching  network.   This  protocol  is
  519.         described in [McQuillan].  It has formed the starting point  for
  520.         all other SPF-based protocols.  The homogeneous Arpanet environ-
  521.         ment, i.e., single-vendor packet switches connected by  synchro-
  522.         nous  serial  lines, simplified the design and implementation of
  523.         the original protocol.
  524.  
  525.         Modifications to  this  protocol  were  proposed  in  [Perlman].
  526.         These modifications dealt with increasing the fault tolerance of
  527.         the routing protocol  through,  among  other  things,  adding  a
  528.         checksum  to  the  link  state advertisements (thereby detecting
  529.         database corruption).  The paper also included means for  reduc-
  530.         ing the routing traffic overhead in an SPF-based protocol.  This
  531.         was accomplished by introducing  mechanisms  which  enabled  the
  532.         interval between link state advertisements to be increased by an
  533.         order of magnitude.
  534.  
  535.         An SPF-based algorithm has also been proposed for use as an  ISO
  536.         IS-IS  routing  protocol.   This protocol is described in [DEC].
  537.         The protocol includes  methods  for  data  and  routing  traffic
  538.         reduction  when  operating  over  broadcast  networks.   This is
  539.         accomplished by election of a Designated Router for each  broad-
  540.         cast  network,  which then originates a link state advertisement
  541.         for the network.
  542.  
  543.         The OSPF subcommittee of the IETF  has  extended  this  work  in
  544.         developing the OSPF protocol.  The Designated Router concept has
  545.         been greatly enhanced to further reduce the  amount  of  routing
  546.         traffic required.  Multicast capabilities are utilized for addi-
  547.         tional routing bandwidth reduction.  An area routing scheme  has
  548.         been developed enabling information hiding/protection/reduction.
  549.         Finally, the algorithm has been modified for efficient operation
  550.         in the internet environment.
  551.  
  552.  
  553.     1.4.  Organization of this document
  554.  
  555.         The first three sections of this specification  give  a  general
  556.         overview of the protocol's capabilities and functions.  Sections
  557.  
  558.  
  559.  
  560. [Moy]                                                          [Page 10]
  561.  
  562. Internet Draft               OSPF Version 2                November 1992
  563.  
  564.  
  565.         4-16 explain the protocol's mechanisms in detail.   Packet  for-
  566.         mats,  protocol  constants,  configuration  items  and  required
  567.         management statistics are specified in the appendices.
  568.  
  569.         Labels such as HelloInterval encountered in the  text  refer  to
  570.         protocol  constants.   They may or may not be configurable.  The
  571.         architectural constants are explained in Appendix B.  The confi-
  572.         gurable constants are explained in Appendix C.
  573.  
  574.         The detailed specification of the protocol is presented in terms
  575.         of  data structures.  This is done in order to make the explana-
  576.         tion more precise.  Implementations of the protocol are required
  577.         to  support  the  functionality  described, but need not use the
  578.         precise data structures that appear in this paper.
  579.  
  580.  
  581. 2.  The Topological Database
  582.  
  583.     The  database  of  the  Autonomous  System's  topology  describes  a
  584.     directed  graph.   The  vertices of the graph consist of routers and
  585.     networks.  A graph edge connects two routers when they are  attached
  586.     via  a physical point-to-point network.  An edge connecting a router
  587.     to a network indicates that the router has an interface on the  net-
  588.     work.
  589.  
  590.     The vertices of the graph can be further typed  according  to  func-
  591.     tion.  Only some of these types carry transit data traffic; that is,
  592.     traffic that is neither locally  originated  nor  locally  destined.
  593.     Vertices  that  can carry transit traffic are indicated on the graph
  594.     by having both incoming and outgoing edges.
  595.  
  596.  
  597.  
  598.                      Vertex type   Vertex name    Transit?
  599.                      _____________________________________
  600.                      1             Router         yes
  601.                      2             Network        yes
  602.                      3             Stub network   no
  603.  
  604.  
  605.                           Table 1: OSPF vertex types.
  606.  
  607.  
  608.     OSPF supports the following types of physical networks:
  609.  
  610.  
  611.     Point-to-point networks
  612.         A network that joins a single pair of routers.   A  56Kb  serial
  613.  
  614.  
  615.  
  616. [Moy]                                                          [Page 11]
  617.  
  618. Internet Draft               OSPF Version 2                November 1992
  619.  
  620.  
  621.         line is an example of a point-to-point network.
  622.  
  623.     Broadcast networks
  624.         Networks supporting  many  (more  than  two)  attached  routers,
  625.         together  with  the capability to address a single physical mes-
  626.         sage to all of the attached  routers  (broadcast).   Neighboring
  627.         routers  are  discovered  dynamically on these nets using OSPF's
  628.         Hello Protocol.  The Hello Protocol itself  takes  advantage  of
  629.         the  broadcast  capability.   The  protocol makes further use of
  630.         multicast capabilities, if they exist.  An ethernet is an  exam-
  631.         ple of a broadcast network.
  632.  
  633.     Non-broadcast networks
  634.         Networks supporting many (more than two) routers, but having  no
  635.         broadcast  capability.   Neighboring routers are also discovered
  636.         on these nets using OSPF's Hello Protocol.  However, due to  the
  637.         lack  of broadcast capability, some configuration information is
  638.         necessary for the correct operation of the Hello  Protocol.   On
  639.         these  networks,  OSPF protocol packets that are normally multi-
  640.         cast need to be sent to each neighboring router,  in  turn.   An
  641.         X.25  Public Data Network (PDN) is an example of a non-broadcast
  642.         network.
  643.  
  644.  
  645.     The neighborhood of each  network  node  in  the  graph  depends  on
  646.     whether  the network has multi-access capabilities (either broadcast
  647.     or non-broadcast) and, if so, the number of routers having an inter-
  648.     face  to  the  network.   The  three cases are depicted in Figure 1.
  649.     Rectangles indicate routers.  Circles and  oblongs  indicate  multi-
  650.     access  networks.  Router names are prefixed with the letters RT and
  651.     network names with N.  Router interface names  are  prefixed  by  I.
  652.     Lines  between  routers  indicate point-to-point networks.  The left
  653.     side of the figure shows a network with its connected routers,  with
  654.     the resulting graph shown on the right.
  655.  
  656.     Two routers joined by a point-to-point network  are  represented  in
  657.     the  directed  graph as being directly connected by a pair of edges,
  658.     one in each direction.  Interfaces to physical  point-to-point  net-
  659.     works need not be assigned IP addresses.  Such a point-to-point net-
  660.     work is called unnumbered.  The graphical representation  of  point-
  661.     to-point  networks  is  designed  so that unnumbered networks can be
  662.     supported naturally.   When  interface  addresses  exist,  they  are
  663.     modelled  as  stub  routes.  Note that each router would then have a
  664.     stub connection to the other router's interface address (see  Figure
  665.     1).
  666.  
  667.     When multiple routers are attached to a  multi-access  network,  the
  668.     directed  graph  shows  all routers bidirectionally connected to the
  669.  
  670.  
  671.  
  672. [Moy]                                                          [Page 12]
  673.  
  674. Internet Draft               OSPF Version 2                November 1992
  675.  
  676.  
  677.  
  678.                                                   **FROM**
  679.  
  680.                                            *      |RT1|RT2|
  681.                 +---+Ia    +---+           *   ------------
  682.                 |RT1|------|RT2|           T   RT1|   | X |
  683.                 +---+    Ib+---+           O   RT2| X |   |
  684.                                            *    Ia|   | X |
  685.                                            *    Ib| X |   |
  686.  
  687.                      Physical point-to-point networks
  688.  
  689.                                                   **FROM**
  690.                 +---+      +---+
  691.                 |RT3|      |RT4|              |RT3|RT4|RT5|RT6|N2 |
  692.                 +---+      +---+        *  ------------------------
  693.                   |    N2    |          *  RT3|   |   |   |   | X |
  694.             +----------------------+    T  RT4|   |   |   |   | X |
  695.                   |          |          O  RT5|   |   |   |   | X |
  696.                 +---+      +---+        *  RT6|   |   |   |   | X |
  697.                 |RT5|      |RT6|        *   N2| X | X | X | X |   |
  698.                 +---+      +---+
  699.  
  700.                           Multi-access networks
  701.  
  702.                                                   **FROM**
  703.                       +---+                *
  704.                       |RT7|                *      |RT7| N3|
  705.                       +---+                T   ------------
  706.                         |                  O   RT7|   |   |
  707.             +----------------------+       *    N3| X |   |
  708.                        N3                  *
  709.  
  710.                        Stub multi-access networks
  711.  
  712.  
  713.  
  714.                     Figure1: Network map components
  715.  
  716.              Networks and routers are represented by vertices.
  717.              An edge connects Vertex A to Vertex B iff the
  718.              intersection of Column A and Row B is marked with
  719.                                   an X.
  720.  
  721.     network vertex (again, see Figure 1).  If only a  single  router  is
  722.     attached  to  a multi-access network, the network will appear in the
  723.     directed graph as a stub connection.
  724.  
  725.  
  726.  
  727.  
  728. [Moy]                                                          [Page 13]
  729.  
  730. Internet Draft               OSPF Version 2                November 1992
  731.  
  732.  
  733.     Each network (stub or transit) in the graph has an  IP  address  and
  734.     associated  network mask.  The mask indicates the number of nodes on
  735.     the network.  Hosts attached directly to  routers  (referred  to  as
  736.     host routes) appear on the graph as stub networks.  The network mask
  737.     for a host route is always 0xffffffff, which indicates the  presence
  738.     of a single node.
  739.  
  740.     Figure 2 shows a sample map of an Autonomous System.  The  rectangle
  741.     labelled  H1 indicates a host, which has a SLIP connection to router
  742.     RT12.  Router RT12 is therefore advertising  a  host  route.   Lines
  743.     between routers indicate physical point-to-point networks.  The only
  744.     point-to-point network that has been assigned interface addresses is
  745.     the  one joining routers RT6 and RT10.  Routers RT5 and RT7 have EGP
  746.     connections to other  Autonomous  Systems.   A  set  of  EGP-learned
  747.     routes have been displayed for both of these routers.
  748.  
  749.     A cost is associated with the output side of each router  interface.
  750.     This  cost  is  configurable by the system administrator.  The lower
  751.     the cost, the more likely the interface is to  be  used  to  forward
  752.     data traffic.  Costs are also associated with the externally derived
  753.     routing data (e.g., the EGP-learned routes).
  754.  
  755.     The directed graph resulting from the map in Figure 2 is depicted in
  756.     Figure  3.   Arcs  are  labelled  with the cost of the corresponding
  757.     router output interface.  Arcs having no labelled cost have  a  cost
  758.     of  0.   Note that arcs leading from networks to routers always have
  759.     cost 0; they are significant nonetheless.  Note also that the exter-
  760.     nally derived routing data appears on the graph as stubs.
  761.  
  762.     The topological database (or what has been referred to above as  the
  763.     directed  graph)  is  pieced together from link state advertisements
  764.     generated by the routers.  The neighborhood of each  transit  vertex
  765.     is represented in a single, separate link state advertisement.  Fig-
  766.     ure 4 shows graphically the link state  representation  of  the  two
  767.     kinds  of  transit  vertices:  routers  and  multi-access  networks.
  768.     Router RT12 has an interface to two broadcast networks  and  a  SLIP
  769.     line  to  a  host.   Network  N6  is  a broadcast network with three
  770.     attached routers.  The cost of all links  from  network  N6  to  its
  771.     attached  routers  is 0.  Note that the link state advertisement for
  772.     network N6 is actually generated by one of the attached routers: the
  773.     router that has been elected Designated Router for the network.
  774.  
  775.     2.1.  The shortest-path tree
  776.  
  777.         When no OSPF areas are configured, each router in the Autonomous
  778.         System  has  an  identical  topological  database, leading to an
  779.         identical graphical  representation.   A  router  generates  its
  780.         routing  table from this graph by calculating a tree of shortest
  781.  
  782.  
  783.  
  784. [Moy]                                                          [Page 14]
  785.  
  786. Internet Draft               OSPF Version 2                November 1992
  787.  
  788.  
  789.  
  790.                  +
  791.                  | 3+---+                     N12      N14
  792.                N1|--|RT1|\ 1                    \ N13 /
  793.                  |  +---+ \                     8\ |8/8
  794.                  +         \ ____                 \|/
  795.                             /    \   1+---+8    8+---+6
  796.                            *  N3  *---|RT4|------|RT5|--------+
  797.                             \____/    +---+      +---+        |
  798.                   +         /   |                  |7         |
  799.                   | 3+---+ /    |                  |          |
  800.                 N2|--|RT2|/1    |1                 |6         |
  801.                   |  +---+    +---+8            6+---+        |
  802.                   +           |RT3|--------------|RT6|        |
  803.                               +---+              +---+        |
  804.                                 |2               Ia|7         |
  805.                                 |                  |          |
  806.                            +---------+             |          |
  807.                                N4                  |          |
  808.                                                    |          |
  809.                                                    |          |
  810.                        N11                         |          |
  811.                    +---------+                     |          |
  812.                         |                          |          |    N12
  813.                         |3                         |          |6 2/
  814.                       +---+                        |        +---+/
  815.                       |RT9|                        |        |RT7|---N15
  816.                       +---+                        |        +---+ 9
  817.                         |1                   +     |          |1
  818.                        _|__                  |   Ib|5       __|_
  819.                       /    \      1+----+2   |  3+----+1   /    \
  820.                      *  N9  *------|RT11|----|---|RT10|---*  N6  *
  821.                       \____/       +----+    |   +----+    \____/
  822.                         |                    |                |
  823.                         |1                   +                |1
  824.              +--+   10+----+                N8              +---+
  825.              |H1|-----|RT12|                                |RT8|
  826.              +--+SLIP +----+                                +---+
  827.                         |2                                    |4
  828.                         |                                     |
  829.                    +---------+                            +--------+
  830.                        N10                                    N7
  831.  
  832.                     Figure 2: A sample Autonomous System
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840. [Moy]                                                          [Page 15]
  841.  
  842. Internet Draft               OSPF Version 2                November 1992
  843.  
  844.  
  845.                                 **FROM**
  846.  
  847.                  |RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
  848.                  |1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9|
  849.               ----- ---------------------------------------------
  850.               RT1|  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |  |
  851.               RT2|  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |  |
  852.               RT3|  |  |  |  |  |6 |  |  |  |  |  |  |0 |  |  |  |
  853.               RT4|  |  |  |  |8 |  |  |  |  |  |  |  |0 |  |  |  |
  854.               RT5|  |  |  |8 |  |6 |6 |  |  |  |  |  |  |  |  |  |
  855.               RT6|  |  |8 |  |7 |  |  |  |  |5 |  |  |  |  |  |  |
  856.               RT7|  |  |  |  |6 |  |  |  |  |  |  |  |  |0 |  |  |
  857.           *   RT8|  |  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |
  858.           *   RT9|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |
  859.           T  RT10|  |  |  |  |  |7 |  |  |  |  |  |  |  |0 |0 |  |
  860.           O  RT11|  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |0 |
  861.           *  RT12|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |
  862.           *    N1|3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  863.                N2|  |3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  864.                N3|1 |1 |1 |1 |  |  |  |  |  |  |  |  |  |  |  |  |
  865.                N4|  |  |2 |  |  |  |  |  |  |  |  |  |  |  |  |  |
  866.                N6|  |  |  |  |  |  |1 |1 |  |1 |  |  |  |  |  |  |
  867.                N7|  |  |  |  |  |  |  |4 |  |  |  |  |  |  |  |  |
  868.                N8|  |  |  |  |  |  |  |  |  |3 |2 |  |  |  |  |  |
  869.                N9|  |  |  |  |  |  |  |  |1 |  |1 |1 |  |  |  |  |
  870.               N10|  |  |  |  |  |  |  |  |  |  |  |2 |  |  |  |  |
  871.               N11|  |  |  |  |  |  |  |  |3 |  |  |  |  |  |  |  |
  872.               N12|  |  |  |  |8 |  |2 |  |  |  |  |  |  |  |  |  |
  873.               N13|  |  |  |  |8 |  |  |  |  |  |  |  |  |  |  |  |
  874.               N14|  |  |  |  |8 |  |  |  |  |  |  |  |  |  |  |  |
  875.               N15|  |  |  |  |  |  |9 |  |  |  |  |  |  |  |  |  |
  876.                H1|  |  |  |  |  |  |  |  |  |  |  |10|  |  |  |  |
  877.  
  878.  
  879.                      Figure 3: The resulting directed graph
  880.  
  881.                  Networks and routers are represented by vertices.
  882.                  An edge of cost X connects Vertex A to Vertex B iff
  883.                  the intersection of Column A and Row B is marked
  884.                                      with an X.
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896. [Moy]                                                          [Page 16]
  897.  
  898. Internet Draft               OSPF Version 2                November 1992
  899.  
  900.  
  901.                      **FROM**                       **FROM**
  902.  
  903.                   |RT12|N9|N10|H1|             |RT9|RT11|RT12|N9|
  904.            *  --------------------          *  ----------------------
  905.            *  RT12|    |  |   |  |          *   RT9|   |    |    |0 |
  906.            T    N9|1   |  |   |  |          T  RT11|   |    |    |0 |
  907.            O   N10|2   |  |   |  |          O  RT12|   |    |    |0 |
  908.            *    H1|10  |  |   |  |          *    N9|   |    |    |  |
  909.            *                                *
  910.                 RT12's router links            N9's Network links
  911.                    advertisement                  advertisement
  912.  
  913.                   Figure 4: Individual link state components
  914.  
  915.               Networks and routers are represented by vertices.
  916.               An edge of cost X connects Vertex A to Vertex B iff
  917.               the intersection of Column A and Row B is marked
  918.                                   with an X.
  919.  
  920.         paths with the router itself as root.  Obviously, the  shortest-
  921.         path  tree  depends  on  the  router doing the calculation.  The
  922.         shortest-path tree for router RT6 in our example is depicted  in
  923.         Figure 5.
  924.  
  925.         The tree gives the entire route to any  destination  network  or
  926.         host.   However, only the next hop to the destination is used in
  927.         the forwarding process.  Note also that the best  route  to  any
  928.         router has also been calculated.  For the processing of external
  929.         data, we note the next hop and distance to any router  advertis-
  930.         ing external routes.  The resulting routing table for router RT6
  931.         is pictured in Table 2.  Note that there is a separate route for
  932.         each  end  of  a  numbered serial line (in this case, the serial
  933.         line between routers RT6 and RT10).
  934.  
  935.  
  936.         Routes to networks belonging to other AS'es (such as N12) appear
  937.         as  dashed  lines on the shortest path tree in Figure 5.  Use of
  938.         this externally derived routing information is considered in the
  939.         next section.
  940.  
  941.  
  942.     2.2.  Use of external routing information
  943.  
  944.         After the tree is created the external  routing  information  is
  945.         examined.   This external routing information may originate from
  946.         another routing protocol such as EGP, or be  statically  config-
  947.         ured  (static  routes).   Default routes can also be included as
  948.         part of the Autonomous System's external routing information.
  949.  
  950.  
  951.  
  952. [Moy]                                                          [Page 17]
  953.  
  954. Internet Draft               OSPF Version 2                November 1992
  955.  
  956.  
  957.  
  958.                                 RT6(origin)
  959.                     RT5 o------------o-----------o Ib
  960.                        /|\    6      |\     7
  961.                      8/8|8\          | \
  962.                      /  |  \         |  \
  963.                     o   |   o        |   \7
  964.                    N12  o  N14       |    \
  965.                        N13        2  |     \
  966.                             N4 o-----o RT3  \
  967.                                     /        \    5
  968.                                   1/     RT10 o-------o Ia
  969.                                   /           |\
  970.                        RT4 o-----o N3        3| \1
  971.                                 /|            |  \ N6     RT7
  972.                                / |         N8 o   o---------o
  973.                               /  |            |   |        /|
  974.                          RT2 o   o RT1        |   |      2/ |9
  975.                             /    |            |   |RT8   /  |
  976.                            /3    |3      RT11 o   o     o   o
  977.                           /      |            |   |    N12 N15
  978.                       N2 o       o N1        1|   |4
  979.                                               |   |
  980.                                            N9 o   o N7
  981.                                              /|
  982.                                             / |
  983.                         N11      RT9       /  |RT12
  984.                          o--------o-------o   o--------o H1
  985.                              3                |   10
  986.                                               |2
  987.                                               |
  988.                                               o N10
  989.  
  990.  
  991.                      Figure 5: The SPF tree for router RT6
  992.  
  993.               Edges that are not marked with a cost have a cost of
  994.               of zero (these are network-to-router links). Routes
  995.               to networks N12-N15 are external information that is
  996.                          considered in Section 2.2
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008. [Moy]                                                          [Page 18]
  1009.  
  1010. Internet Draft               OSPF Version 2                November 1992
  1011.  
  1012.  
  1013.                    Destination   Next  Hop   Distance
  1014.                    __________________________________
  1015.                    N1            RT3         10
  1016.                    N2            RT3         10
  1017.                    N3            RT3         7
  1018.                    N4            RT3         8
  1019.                    Ib            *           7
  1020.                    Ia            RT10        12
  1021.                    N6            RT10        8
  1022.                    N7            RT10        12
  1023.                    N8            RT10        10
  1024.                    N9            RT10        11
  1025.                    N10           RT10        13
  1026.                    N11           RT10        14
  1027.                    H1            RT10        21
  1028.                    __________________________________
  1029.                    RT5           RT5         6
  1030.                    RT7           RT10        8
  1031.  
  1032.  
  1033.     Table 2: The portion of router RT6's routing table listing local
  1034.                              destinations.
  1035.  
  1036.         External routing information is flooded unaltered throughout the
  1037.         AS.   In  our  example, all the routers in the Autonomous System
  1038.         know that router RT7 has two external routes, with metrics 2 and
  1039.         9.
  1040.  
  1041.         OSPF supports two types of external metrics.   Type  1  external
  1042.         metrics  are equivalent to the link state metric.  Type 2 exter-
  1043.         nal metrics are greater than the cost of any  path  internal  to
  1044.         the  AS.   Use  of  Type 2 external metrics assumes that routing
  1045.         between AS'es is the major cost of routing a packet,  and  elim-
  1046.         inates  the  need  for  conversion of external costs to internal
  1047.         link state metrics.
  1048.  
  1049.         Here is an example of Type 1 external metric  processing.   Sup-
  1050.         pose  that  the  routers RT7 and RT5 in Figure 2 are advertising
  1051.         Type 1 external metrics.  For each external route, the  distance
  1052.         from Router RT6 is calculated as the sum of the external route's
  1053.         cost and the distance from Router RT6 to the advertising router.
  1054.         For every external destination, the router advertising the shor-
  1055.         test route is discovered, and the next hop  to  the  advertising
  1056.         router becomes the next hop to the destination.
  1057.  
  1058.         Both Router RT5 and RT7 are advertising  an  external  route  to
  1059.         destination  network  N12.   Router RT7 is preferred since it is
  1060.         advertising N12 at a distance of 10 (8+2) to Router  RT6,  which
  1061.  
  1062.  
  1063.  
  1064. [Moy]                                                          [Page 19]
  1065.  
  1066. Internet Draft               OSPF Version 2                November 1992
  1067.  
  1068.  
  1069.         is better than router RT5's 14 (6+8).  Table 3 shows the entries
  1070.         that are added to the routing table  when  external  routes  are
  1071.         examined:
  1072.  
  1073.  
  1074.  
  1075.                          Destination   Next  Hop   Distance
  1076.                          __________________________________
  1077.                          N12           RT10        10
  1078.                          N13           RT5         14
  1079.                          N14           RT5         14
  1080.                          N15           RT10        17
  1081.  
  1082.  
  1083.                  Table 3: The portion of router RT6's routing table
  1084.                            listing external destinations.
  1085.  
  1086.  
  1087.         Processing of Type 2 external metrics is simpler.  The AS  boun-
  1088.         dary  router advertising the smallest external metric is chosen,
  1089.         regardless of the internal distance to the AS  boundary  router.
  1090.         Suppose  in  our  example  both  router  RT5 and router RT7 were
  1091.         advertising Type 2 external routes.  Then all  traffic  destined
  1092.         for  network  N12 would be forwarded to router RT7, since 2 < 8.
  1093.         When several equal-cost Type 2 routes exist, the  internal  dis-
  1094.         tance to the advertising routers is used to break the tie.
  1095.  
  1096.         Both Type 1 and Type 2 external metrics can be present in the AS
  1097.         at the same time.  In that event, Type 1 external metrics always
  1098.         take precedence.
  1099.  
  1100.         This section has assumed that packets destined for external des-
  1101.         tinations  are always routed through the advertising AS boundary
  1102.         router.  This is not always desirable.  For example, suppose  in
  1103.         Figure  2  there is an additional router attached to network N6,
  1104.         called Router RTX.  Suppose further that RTX does  not  partici-
  1105.         pate in OSPF routing, but does exchange EGP information with the
  1106.         AS boundary router RT7.  Then, router RT7 would end up advertis-
  1107.         ing  OSPF  external  routes  for all destinations that should be
  1108.         routed to RTX.  An extra hop will  sometimes  be  introduced  if
  1109.         packets  for  these  destinations need always be routed first to
  1110.         router RT7 (the advertising router).
  1111.  
  1112.         To deal with this situation, the  OSPF  protocol  allows  an  AS
  1113.         boundary  router to specify a "forwarding address" in its exter-
  1114.         nal advertisements.  In the  above  example,  Router  RT7  would
  1115.         specify  RTX's  IP  address  as the "forwarding address" for all
  1116.         those destinations whose packets should be  routed  directly  to
  1117.  
  1118.  
  1119.  
  1120. [Moy]                                                          [Page 20]
  1121.  
  1122. Internet Draft               OSPF Version 2                November 1992
  1123.  
  1124.  
  1125.         RTX.
  1126.  
  1127.         The "forwarding address" has one other application.  It  enables
  1128.         routers  in  the  Autonomous  System's  interior  to function as
  1129.         "route servers".  For example, in Figure 2 the router RT6  could
  1130.         become  a  route  server,  gaining  external routing information
  1131.         through a combination of static configuration and external rout-
  1132.         ing protocols.  RT6 would then start advertising itself as an AS
  1133.         boundary router, and would originate a collection of OSPF exter-
  1134.         nal  advertisements.  In each external advertisement, router RT6
  1135.         would specify the correct Autonomous System exit  point  to  use
  1136.         for   the   destination   through  appropriate  setting  of  the
  1137.         advertisement's "forwarding address" field.
  1138.  
  1139.  
  1140.     2.3.  Equal-cost multipath
  1141.  
  1142.         The above discussion has been simplified by considering  only  a
  1143.         single  route  to  any  destination.   In  reality,  if multiple
  1144.         equal-cost  routes  to  a  destination  exist,  they   are   all
  1145.         discovered and used.  This requires no conceptual changes to the
  1146.         algorithm, and its discussion is postponed until we consider the
  1147.         tree-building process in more detail.
  1148.  
  1149.         With equal cost multipath,  a  router  potentially  has  several
  1150.         available next hops towards any given destination.
  1151.  
  1152.  
  1153.     2.4.  TOS-based routing
  1154.  
  1155.         OSPF can calculate a separate set of routes for each IP Type  of
  1156.         Service.   The  IP TOS values are represented in OSPF exactly as
  1157.         they appear in the IP packet header.  This means that,  for  any
  1158.         destination,  there  can  potentially  be multiple routing table
  1159.         entries, one for each IP TOS.
  1160.  
  1161.         Up to this point, all examples shown have assumed that routes do
  1162.         not vary on TOS.  In order to differentiate routes based on TOS,
  1163.         separate interface costs can be configured for  each  TOS.   For
  1164.         example, in Figure 2 there could be multiple costs (one for each
  1165.         TOS) listed for each interface.  A cost for TOS 0 must always be
  1166.         specified.
  1167.  
  1168.         When interface costs vary based on TOS, a separate shortest path
  1169.         tree is calculated for each TOS (see Section 2.1).  In addition,
  1170.         external costs can vary based on TOS.  For example, in Figure  2
  1171.         router RT7 could advertise a separate type 1 external metric for
  1172.         each TOS.  Then, when calculating the TOS X distance to  network
  1173.  
  1174.  
  1175.  
  1176. [Moy]                                                          [Page 21]
  1177.  
  1178. Internet Draft               OSPF Version 2                November 1992
  1179.  
  1180.  
  1181.         N15 the cost of the shortest TOS X path to RT7 would be added to
  1182.         the TOS X cost advertised by RT7 (see Section 2.2).
  1183.  
  1184.         All OSPF implementations must be capable of  calculating  routes
  1185.         based  on TOS.  However, OSPF routers can be configured to route
  1186.         all packets on the TOS 0 path (see Appendix C), eliminating  the
  1187.         need  to calculate non-zero TOS paths.  This can be used to con-
  1188.         serve routing  table  space  and  processing  resources  in  the
  1189.         router.  These TOS-0-only routers can be mixed with routers that
  1190.         do route based on TOS.  TOS-0-only routers will  be  avoided  as
  1191.         much  as  possible when forwarding traffic requesting a non-zero
  1192.         TOS.
  1193.  
  1194.         It may be the case that no path exists for  some  non-zero  TOS,
  1195.         even  if  the router is calculating non-zero TOS paths.  In that
  1196.         case, packets requesting that non-zero TOS are routed along  the
  1197.         TOS 0 path (see Section 11.1).
  1198.  
  1199.  
  1200. 3.  Splitting the AS into Areas
  1201.  
  1202.     OSPF allows collections of  contiguous  networks  and  hosts  to  be
  1203.     grouped  together.   Such  a group, together with the routers having
  1204.     interfaces to any one of the included networks, is called  an  area.
  1205.     Each  area  runs a separate copy of the basic SPF routing algorithm.
  1206.     This means that each area  has  its  own  topological  database  and
  1207.     corresponding graph, as explained in the previous section.
  1208.  
  1209.     The topology of an area is invisible from the outside of  the  area.
  1210.     Conversely,  routers  internal  to  a given area know nothing of the
  1211.     detailed topology external to the area.  This isolation of knowledge
  1212.     enables the protocol to effect a marked reduction in routing traffic
  1213.     as compared to treating the entire Autonomous System as a single SPF
  1214.     domain.
  1215.  
  1216.     With the introduction of areas,  it  is  no  longer  true  that  all
  1217.     routers  in the AS have an identical topological database.  A router
  1218.     actually has a separate topological database for  each  area  it  is
  1219.     connected  to.  (Routers connected to multiple areas are called area
  1220.     border routers).  Two routers belonging to the same area  have,  for
  1221.     that area, identical area topological databases.
  1222.  
  1223.     Routing in the Autonomous System takes place on two levels,  depend-
  1224.     ing  on whether the source and destination of a packet reside in the
  1225.     same area (intra-area routing is used) or  different  areas  (inter-
  1226.     area  routing is used).  In intra-area routing, the packet is routed
  1227.     solely on information obtained within the area; no routing  informa-
  1228.     tion  obtained  from  outside  the  area can be used.  This protects
  1229.  
  1230.  
  1231.  
  1232. [Moy]                                                          [Page 22]
  1233.  
  1234. Internet Draft               OSPF Version 2                November 1992
  1235.  
  1236.  
  1237.     intra-area routing from the injection of  bad  routing  information.
  1238.     We discuss inter-area routing in Section 3.2.
  1239.  
  1240.  
  1241.     3.1.  The backbone of the Autonomous System
  1242.  
  1243.         The backbone consists of those networks  not  contained  in  any
  1244.         area,  their  attached routers, and those routers that belong to
  1245.         multiple areas.  The backbone must be contiguous.
  1246.  
  1247.         It is possible to define areas in such a way that  the  backbone
  1248.         is  no longer contiguous.  In this case the system administrator
  1249.         must restore backbone connectivity by configuring virtual links.
  1250.  
  1251.         Virtual links can be configured between any two backbone routers
  1252.         that  have  an interface to a common non-backbone area.  Virtual
  1253.         links belong to the backbone.  The protocol treats  two  routers
  1254.         joined  by a virtual link as if they were connected by an unnum-
  1255.         bered point-to-point network.  On the graph of the backbone, two
  1256.         such  routers  are joined by arcs whose costs are the intra-area
  1257.         distances between the two routers.  The routing protocol traffic
  1258.         that flows along the virtual link uses intra-area routing only.
  1259.  
  1260.         The backbone is responsible for distributing routing information
  1261.         between areas.  The backbone itself has all of the properties of
  1262.         an area.  The topology of the backbone is invisible to  each  of
  1263.         the areas, while the backbone itself knows nothing of the topol-
  1264.         ogy of the areas.
  1265.  
  1266.  
  1267.     3.2.  Inter-area routing
  1268.  
  1269.         When routing a packet between two areas the  backbone  is  used.
  1270.         The path that the packet will travel can be broken up into three
  1271.         contiguous pieces: an intra-area path from the source to an area
  1272.         border  router,  a backbone path between the source and destina-
  1273.         tion areas, and then another intra-area path to the destination.
  1274.         The algorithm finds the set of such paths that have the smallest
  1275.         cost.
  1276.  
  1277.         Looking at this another way, inter-area routing can be  pictured
  1278.         as  forcing  a star configuration on the Autonomous System, with
  1279.         the backbone as hub and and each of the areas as spokes.
  1280.  
  1281.         The topology of the backbone dictates the  backbone  paths  used
  1282.         between  areas.  The topology of the backbone can be enhanced by
  1283.         adding virtual links.  This gives the system administrator  some
  1284.         control over the routes taken by inter-area traffic.
  1285.  
  1286.  
  1287.  
  1288. [Moy]                                                          [Page 23]
  1289.  
  1290. Internet Draft               OSPF Version 2                November 1992
  1291.  
  1292.  
  1293.         The correct area border router to use as the  packet  exits  the
  1294.         source  area is chosen in exactly the same way routers advertis-
  1295.         ing external routes are chosen.  Each area border router  in  an
  1296.         area  summarizes  for the area its cost to all networks external
  1297.         to the area.  After the SPF tree is  calculated  for  the  area,
  1298.         routes  to  all  other  networks are calculated by examining the
  1299.         summaries of the area border routers.
  1300.  
  1301.  
  1302.     3.3.  Classification of routers
  1303.  
  1304.         Before the introduction of areas, the only OSPF routers having a
  1305.         specialized  function  were  those  advertising external routing
  1306.         information, such as router RT5 in Figure 2.   When  the  AS  is
  1307.         split into OSPF areas, the routers are further divided according
  1308.         to function into the following four overlapping categories:
  1309.  
  1310.  
  1311.         Internal routers
  1312.             A router with all directly connected networks  belonging  to
  1313.             the  same  area.  Routers with only backbone interfaces also
  1314.             belong to this category.  These routers run a single copy of
  1315.             the basic routing algorithm.
  1316.  
  1317.         Area border routers
  1318.             A router that  attaches  to  multiple  areas.   Area  border
  1319.             routers run multiple copies of the basic algorithm, one copy
  1320.             for each attached area and an additional copy for the  back-
  1321.             bone.  Area border routers condense the topological informa-
  1322.             tion of their attached areas for distribution to  the  back-
  1323.             bone.   The  backbone in turn distributes the information to
  1324.             the other areas.
  1325.  
  1326.         Backbone routers
  1327.             A router that  has  an  interface  to  the  backbone.   This
  1328.             includes  all  routers  that interface to more than one area
  1329.             (i.e., area border routers).  However, backbone  routers  do
  1330.             not have to be area border routers.  Routers with all inter-
  1331.             faces connected to the backbone are considered to be  inter-
  1332.             nal routers.
  1333.  
  1334.         AS boundary routers
  1335.             A router that exchanges  routing  information  with  routers
  1336.             belonging to other Autonomous Systems.  Such a router has AS
  1337.             external routes that are  advertised  throughout  the  Auto-
  1338.             nomous System.  The path to each AS boundary router is known
  1339.             by every router in the  AS.   This  classification  is  com-
  1340.             pletely  independent  of  the  previous  classifications: AS
  1341.  
  1342.  
  1343.  
  1344. [Moy]                                                          [Page 24]
  1345.  
  1346. Internet Draft               OSPF Version 2                November 1992
  1347.  
  1348.  
  1349.             boundary routers may be internal or area border routers, and
  1350.             may or may not participate in the backbone.
  1351.  
  1352.  
  1353.     3.4.  A sample area configuration
  1354.  
  1355.         Figure 6 shows a sample area configuration.  The first area con-
  1356.         sists  of networks N1-N4, along with their attached routers RT1-
  1357.         RT4.  The second area consists of  networks  N6-N8,  along  with
  1358.         their  attached  routers  RT7,  RT8, RT10, RT11.  The third area
  1359.         consists of networks  N9-N11  and  host  H1,  along  with  their
  1360.         attached  routers RT9, RT11, RT12.  The third area has been con-
  1361.         figured so that networks N9-N11 and host H1 will all be  grouped
  1362.         into  a  single route, when advertised external to the area (see
  1363.         Section 3.5 for more details).
  1364.  
  1365.         In Figure 6, routers RT1, RT2, RT5, RT6, RT8, RT9 and  RT12  are
  1366.         internal routers.  Routers RT3, RT4, RT7, RT10 and RT11 are area
  1367.         border routers.  Finally as before, routers RT5 and RT7  are  AS
  1368.         boundary routers.
  1369.  
  1370.         Figure 7 shows the resulting topological database for  the  Area
  1371.         1.  The figure completely describes that area's intra-area rout-
  1372.         ing.  It also shows the complete view of the  internet  for  the
  1373.         two  internal  routers  RT1  and RT2.  It is the job of the area
  1374.         border routers, RT3 and RT4, to advertise into Area 1  the  dis-
  1375.         tances  to  all  destinations  external  to the area.  These are
  1376.         indicated in Figure 7 by the dashed stub routes.  Also, RT3  and
  1377.         RT4  must  advertise into Area 1 the location of the AS boundary
  1378.         routers RT5 and RT7.  Finally, external advertisements from  RT5
  1379.         and  RT7 are flooded throughout the entire AS, and in particular
  1380.         throughout Area 1.  These advertisements are  included  in  Area
  1381.         1's database, and yield routes to networks N12-N15.
  1382.  
  1383.         Routers RT3 and RT4 must also summarize Area  1's  topology  for
  1384.         distribution to the backbone.  Their backbone advertisements are
  1385.         shown in Table 4.  These summaries show which networks are  con-
  1386.         tained  in  Area  1  (i.e., networks N1-N4), and the distance to
  1387.         these networks from the routers RT3 and RT4 respectively.
  1388.  
  1389.  
  1390.         The topological database for the backbone is shown in Figure  8.
  1391.         The  set  of  routers pictured are the backbone routers.  Router
  1392.         RT11 is a backbone router because it belongs to two  areas.   In
  1393.         order  to  make  the backbone connected, a virtual link has been
  1394.         configured between routers R10 and R11.
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400. [Moy]                                                          [Page 25]
  1401.  
  1402. Internet Draft               OSPF Version 2                November 1992
  1403.  
  1404.  
  1405.  
  1406.              ...........................
  1407.              .   +                     .
  1408.              .   | 3+---+              .      N12      N14
  1409.              . N1|--|RT1|\ 1           .        \ N13 /
  1410.              .   |  +---+ \            .        8\ |8/8
  1411.              .   +         \ ____      .          \|/
  1412.              .              /    \   1+---+8    8+---+6
  1413.              .             *  N3  *---|RT4|------|RT5|--------+
  1414.              .              \____/    +---+      +---+        |
  1415.              .    +         /   |      .           |7         |
  1416.              .    | 3+---+ /    |      .           |          |
  1417.              .  N2|--|RT2|/1    |1     .           |6         |
  1418.              .    |  +---+    +---+8   .        6+---+        |
  1419.              .    +           |RT3|--------------|RT6|        |
  1420.              .                +---+    .         +---+        |
  1421.              .                  |2     .         Ia|7         |
  1422.              .                  |      .           |          |
  1423.              .             +---------+ .           |          |
  1424.              .Area 1           N4      .           |          |
  1425.              ...........................           |          |
  1426.           ..........................               |          |
  1427.           .            N11         .               |          |
  1428.           .        +---------+     .               |          |
  1429.           .             |          .               |          |    N12
  1430.           .             |3         .               |          |6 2/
  1431.           .           +---+        .               |        +---+/
  1432.           .           |RT9|        .    ...........|........|RT7|---N15.
  1433.           .           +---+        .    .          |        +---+ 9    .
  1434.           .             |1         .    .    +     |          |1       .
  1435.           .            _|__        .    .    |   Ib|5       __|_       .
  1436.           .           /    \      1+----+2   |  3+----+1   /    \      .
  1437.           .          *  N9  *------|RT11|----|---|RT10|---*  N6  *     .
  1438.           .           \____/       +----+    |   +----+    \____/      .
  1439.           .             |          .    .    |                |        .
  1440.           .             |1         .    .    +                |1       .
  1441.           .  +--+   10+----+       .    .   N8              +---+      .
  1442.           .  |H1|-----|RT12|       .    .                   |RT8|      .
  1443.           .  +--+SLIP +----+       .    .                   +---+      .
  1444.           .             |2         .    .                     |4       .
  1445.           .             |          .    .                     |        .
  1446.           .        +---------+     .    .                 +--------+   .
  1447.           .            N10         .    .                     N7       .
  1448.           .                        .    .Area 2                        .
  1449.           .Area 3                  .    ................................
  1450.           ..........................
  1451.  
  1452.                     Figure 6: A sample OSPF area configuration
  1453.  
  1454.  
  1455.  
  1456. [Moy]                                                          [Page 26]
  1457.  
  1458. Internet Draft               OSPF Version 2                November 1992
  1459.  
  1460.  
  1461.                      Network   RT3 adv.   RT4 adv.
  1462.                      _____________________________
  1463.                      N1        4          4
  1464.                      N2        4          4
  1465.                      N3        1          1
  1466.                      N4        2          3
  1467.  
  1468.  
  1469.               Table 4: Networks advertised to the backbone
  1470.                         by routers RT3 and RT4.
  1471.  
  1472.                                **FROM**
  1473.  
  1474.                           |RT|RT|RT|RT|RT|RT|
  1475.                           |1 |2 |3 |4 |5 |7 |N3|
  1476.                        ----- -------------------
  1477.                        RT1|  |  |  |  |  |  |0 |
  1478.                        RT2|  |  |  |  |  |  |0 |
  1479.                        RT3|  |  |  |  |  |  |0 |
  1480.                    *   RT4|  |  |  |  |  |  |0 |
  1481.                    *   RT5|  |  |14|8 |  |  |  |
  1482.                    T   RT7|  |  |20|14|  |  |  |
  1483.                    O    N1|3 |  |  |  |  |  |  |
  1484.                    *    N2|  |3 |  |  |  |  |  |
  1485.                    *    N3|1 |1 |1 |1 |  |  |  |
  1486.                         N4|  |  |2 |  |  |  |  |
  1487.                      Ia,Ib|  |  |15|22|  |  |  |
  1488.                         N6|  |  |16|15|  |  |  |
  1489.                         N7|  |  |20|19|  |  |  |
  1490.                         N8|  |  |18|18|  |  |  |
  1491.                  N9-N11,H1|  |  |19|16|  |  |  |
  1492.                        N12|  |  |  |  |8 |2 |  |
  1493.                        N13|  |  |  |  |8 |  |  |
  1494.                        N14|  |  |  |  |8 |  |  |
  1495.                        N15|  |  |  |  |  |9 |  |
  1496.  
  1497.                       Figure 7: Area 1's Database.
  1498.  
  1499.               Networks and routers are represented by vertices.
  1500.               An edge of cost X connects Vertex A to Vertex B iff
  1501.               the intersection of Column A and Row B is marked
  1502.                                with an X.
  1503.  
  1504.         Again, routers RT3, RT4, RT7, RT10  and  RT11  are  area  border
  1505.         routers.   As routers RT3 and RT4 did above, they have condensed
  1506.         the routing information of their attached areas for distribution
  1507.         via the backbone; these are the dashed stubs that appear in Fig-
  1508.         ure 8.  Remember that the third  area  has  been  configured  to
  1509.  
  1510.  
  1511.  
  1512. [Moy]                                                          [Page 27]
  1513.  
  1514. Internet Draft               OSPF Version 2                November 1992
  1515.  
  1516.  
  1517.         condense  networks N9-N11 and Host H1 into a single route.  This
  1518.         yields a single dashed line for networks N9-N11 and Host  H1  in
  1519.         Figure  8.   Routers  RT5 and RT7 are AS boundary routers; their
  1520.         externally derived information also appears on the graph in Fig-
  1521.         ure 8 as stubs.
  1522.  
  1523.         The backbone enables the exchange of summary information between
  1524.         area  border  routers.   Every area border router hears the area
  1525.         summaries from all other area border routers.  It then  forms  a
  1526.         picture  of  the distance to all networks outside of its area by
  1527.         examining  the  collected  advertisements,  and  adding  in  the
  1528.  
  1529.                                   **FROM**
  1530.  
  1531.                             |RT|RT|RT|RT|RT|RT|RT
  1532.                             |3 |4 |5 |6 |7 |10|11|
  1533.                          ------------------------
  1534.                          RT3|  |  |  |6 |  |  |  |
  1535.                          RT4|  |  |8 |  |  |  |  |
  1536.                          RT5|  |8 |  |6 |6 |  |  |
  1537.                          RT6|8 |  |7 |  |  |5 |  |
  1538.                          RT7|  |  |6 |  |  |  |  |
  1539.                      *  RT10|  |  |  |7 |  |  |2 |
  1540.                      *  RT11|  |  |  |  |  |3 |  |
  1541.                      T    N1|4 |4 |  |  |  |  |  |
  1542.                      O    N2|4 |4 |  |  |  |  |  |
  1543.                      *    N3|1 |1 |  |  |  |  |  |
  1544.                      *    N4|2 |3 |  |  |  |  |  |
  1545.                           Ia|  |  |  |  |  |5 |  |
  1546.                           Ib|  |  |  |7 |  |  |  |
  1547.                           N6|  |  |  |  |1 |1 |3 |
  1548.                           N7|  |  |  |  |5 |5 |7 |
  1549.                           N8|  |  |  |  |4 |3 |2 |
  1550.                    N9-N11,H1|  |  |  |  |  |  |1 |
  1551.                          N12|  |  |8 |  |2 |  |  |
  1552.                          N13|  |  |8 |  |  |  |  |
  1553.                          N14|  |  |8 |  |  |  |  |
  1554.                          N15|  |  |  |  |9 |  |  |
  1555.  
  1556.  
  1557.                      Figure 8: The backbone's database.
  1558.  
  1559.               Networks and routers are represented by vertices.
  1560.               An edge of cost X connects Vertex A to Vertex B iff
  1561.               the intersection of Column A and Row B is marked
  1562.                                  with an X.
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568. [Moy]                                                          [Page 28]
  1569.  
  1570. Internet Draft               OSPF Version 2                November 1992
  1571.  
  1572.  
  1573.         backbone distance to each advertising router.
  1574.  
  1575.         Again using routers RT3 and RT4 as  an  example,  the  procedure
  1576.         goes as follows: They first calculate the SPF tree for the back-
  1577.         bone.  This  gives  the  distances  to  all  other  area  border
  1578.         routers.   Also  noted are the distances to networks (Ia and Ib)
  1579.         and AS boundary routers (RT5 and RT7) that belong to  the  back-
  1580.         bone.  This calculation is shown in Table 5.
  1581.  
  1582.  
  1583.         Next, by looking at the area summaries from  these  area  border
  1584.         routers,  RT3 and RT4 can determine the distance to all networks
  1585.         outside their area.  These distances are then advertised  inter-
  1586.         nally  to  the  area  by  RT3  and RT4.  The advertisements that
  1587.         router RT3 and RT4 will make into Area 1 are shown in  Table  6.
  1588.         Note that Table 6 assumes that an area range has been configured
  1589.         for the backbone which groups I5 and I6 into a single advertise-
  1590.         ment.
  1591.  
  1592.  
  1593.         The information imported into Area 1  by  routers  RT3  and  RT4
  1594.         enables  an  internal  router,  such  as  RT1, to choose an area
  1595.         border router intelligently.   Router  RT1  would  use  RT4  for
  1596.         traffic to network N6, RT3 for traffic to network N10, and would
  1597.         load share between the two for traffic to network N8.
  1598.  
  1599.  
  1600.  
  1601.                  Area  border   dist  from   dist  from
  1602.                  router         RT3          RT4
  1603.                  ______________________________________
  1604.                  to  RT3        *            21
  1605.                  to  RT4        22           *
  1606.                  to  RT7        20           14
  1607.                  to  RT10       15           22
  1608.                  to  RT11       18           25
  1609.                  ______________________________________
  1610.                  to  Ia         20           27
  1611.                  to  Ib         15           22
  1612.                  ______________________________________
  1613.                  to  RT5        14           8
  1614.                  to  RT7        20           14
  1615.  
  1616.  
  1617.                  Table 5: Backbone distances calculated
  1618.                         by routers RT3 and RT4.
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624. [Moy]                                                          [Page 29]
  1625.  
  1626. Internet Draft               OSPF Version 2                November 1992
  1627.  
  1628.  
  1629.  
  1630.  
  1631.                    Destination   RT3 adv.   RT4 adv.
  1632.                    _________________________________
  1633.                    Ia,Ib         15         22
  1634.                    N6            16         15
  1635.                    N7            20         19
  1636.                    N8            18         18
  1637.                    N9-N11,H1     19         26
  1638.                    _________________________________
  1639.                    RT5           14         8
  1640.                    RT7           20         14
  1641.  
  1642.  
  1643.               Table 6: Destinations advertised into Area 1
  1644.                         by routers RT3 and RT4.
  1645.  
  1646.         Router RT1 can also determine in this manner the  shortest  path
  1647.         to the AS boundary routers RT5 and RT7.  Then, by looking at RT5
  1648.         and RT7's external advertisements, router RT1 can decide between
  1649.         RT5  or  RT7 when sending to a destination in another Autonomous
  1650.         System (one of the networks N12-N15).
  1651.  
  1652.         Note that a failure of the line between  routers  RT6  and  RT10
  1653.         will  cause  the  backbone  to become disconnected.  Configuring
  1654.         another virtual link between routers RT7 and RT10 will give  the
  1655.         backbone more connectivity and more resistance to such failures.
  1656.         Also, a virtual link between RT7 and RT10  would  allow  a  much
  1657.         shorter  path  between  the  third  area (containing N9) and the
  1658.         router RT7, which is advertising a good route to  external  net-
  1659.         work N12.
  1660.  
  1661.  
  1662.     3.5.  IP subnetting support
  1663.  
  1664.         OSPF attaches an IP address mask to each advertised route.   The
  1665.         mask  indicates  the  range  of addresses being described by the
  1666.         particular route.  For example, a summary advertisement for  the
  1667.         destination  128.185.0.0  with  a mask of 0xffff0000 actually is
  1668.         describing a single route  to  the  collection  of  destinations
  1669.         128.185.0.0  -  128.185.255.255.   Similarly,  host  routes  are
  1670.         always advertised with a  mask  of  0xffffffff,  indicating  the
  1671.         presence of only a single destination.
  1672.  
  1673.         Including the mask with each advertised destination enables  the
  1674.         implementation  of  what  is  commonly  referred to as variable-
  1675.         length subnet masks.  This means that a single IP class A, B, or
  1676.         C  network  number can be broken up into many subnets of various
  1677.  
  1678.  
  1679.  
  1680. [Moy]                                                          [Page 30]
  1681.  
  1682. Internet Draft               OSPF Version 2                November 1992
  1683.  
  1684.  
  1685.         sizes.  For example, the network 128.185.0.0 could be broken  up
  1686.         into  64  variable-sized subnets: 16 subnets of size 4K, 16 sub-
  1687.         nets of size 256, and 32 subnets of size 8.  Table 7 shows  some
  1688.         of the resulting network addresses together with their masks:
  1689.  
  1690.  
  1691.  
  1692.                   Network address   IP address mask   Subnet size
  1693.                   _______________________________________________
  1694.                   128.185.16.0      0xfffff000        4K
  1695.                   128.185.1.0       0xffffff00        256
  1696.                   128.185.0.8       0xfffffff8        8
  1697.  
  1698.  
  1699.                          Table 7: Some sample subnet sizes.
  1700.  
  1701.  
  1702.         There are many possible ways of dividing up a class A, B, and  C
  1703.         network  into variable sized subnets.  The precise procedure for
  1704.         doing so is beyond the scope of this specification.  The specif-
  1705.         ication  however establishes the following guideline: When an IP
  1706.         packet is forwarded, it is always forwarded to the network  that
  1707.         is the best match for the packet's destination.  Here best match
  1708.         is synonymous with the longest  or  most  specific  match.   For
  1709.         example,  the default route with destination of 0.0.0.0 and mask
  1710.         0x00000000 is always a match for every IP destination.   Yet  it
  1711.         is always less specific than any other match.  Subnet masks must
  1712.         be assigned so that the best match for  any  IP  destination  is
  1713.         unambiguous.
  1714.  
  1715.         The OSPF area concept is modelled after an IP subnetted network.
  1716.         OSPF  areas have been loosely defined to be a collection of net-
  1717.         works.  In actuality, an OSPF area is specified to be a list  of
  1718.         address ranges (see Section C.2 for more details).  Each address
  1719.         range is defined as an [address,mask] pair.  Many separate  net-
  1720.         works may then be contained in a single address range, just as a
  1721.         subnetted network is composed of many  separate  subnets.   Area
  1722.         border  routers  then summarize the area contents (for distribu-
  1723.         tion to the backbone) by advertising a  single  route  for  each
  1724.         address range.  The cost of the route is the minimum cost to any
  1725.         of the networks falling in the specified range.
  1726.  
  1727.         For example, an IP subnetted network can be configured as a sin-
  1728.         gle  OSPF  area.   In  that case, the area would be defined as a
  1729.         single address range: a class A, B, or C  network  number  along
  1730.         with  its natural IP mask.  Inside the area, any number of vari-
  1731.         able sized subnets could be defined.  External to  the  area,  a
  1732.         single   route   for  the  entire  subnetted  network  would  be
  1733.  
  1734.  
  1735.  
  1736. [Moy]                                                          [Page 31]
  1737.  
  1738. Internet Draft               OSPF Version 2                November 1992
  1739.  
  1740.  
  1741.         distributed, hiding even the fact that the network is  subnetted
  1742.         at  all.   The  cost  of this route is the minimum of the set of
  1743.         costs to the component subnets.
  1744.  
  1745.  
  1746.     3.6.  Supporting stub areas
  1747.  
  1748.         In some Autonomous Systems,  the  majority  of  the  topological
  1749.         database may consist of external advertisements.  An OSPF exter-
  1750.         nal advertisement is usually flooded throughout the  entire  AS.
  1751.         However,  OSPF  allows  certain  areas to be configured as "stub
  1752.         areas".  External advertisements are not flooded into/throughout
  1753.         stub  areas;  routing to AS external destinations in these areas
  1754.         is based on a (per-area) default only.  This reduces  the  topo-
  1755.         logical  database  size,  and therefore the memory requirements,
  1756.         for a stub area's internal routers.
  1757.  
  1758.         In order to take  advantage  of  the  OSPF  stub  area  support,
  1759.         default  routing  must be used in the stub area.  This is accom-
  1760.         plished as follows.  One or more of the stub area's area  border
  1761.         routers  must  advertise  a default route into the stub area via
  1762.         summary advertisements.   These  summary  defaults  are  flooded
  1763.         throughout  the  stub  area,  but  no further.  (For this reason
  1764.         these defaults pertain only to the particular stub area).  These
  1765.         summary  default  routes  will match any destination that is not
  1766.         explicitly reachable by an intra-area or inter-area path  (i.e.,
  1767.         AS external destinations).
  1768.  
  1769.         An area can be configured as stub when there is  a  single  exit
  1770.         point  from  the area, or when the choice of exit point need not
  1771.         be made on a per-external-destination basis.  For example,  area
  1772.         3  in  Figure  6 could be configured as a stub area, because all
  1773.         external traffic must  travel  though  its  single  area  border
  1774.         router  RT11.   If area 3 were configured as a stub, router RT11
  1775.         would advertise a default route for distribution inside  area  3
  1776.         (in  a  summary advertisement), instead of flooding the external
  1777.         advertisements for networks N12-N15 into/throughout the area.
  1778.  
  1779.         The OSPF protocol ensures that all routers belonging to an  area
  1780.         agree  on  whether the area has been configured as a stub.  This
  1781.         guarantees that no confusion  will  arise  in  the  flooding  of
  1782.         external advertisements.
  1783.  
  1784.         There are a couple of restrictions on the  use  of  stub  areas.
  1785.         Virtual links cannot be configured through stub areas.  In addi-
  1786.         tion, AS boundary routers cannot  be  placed  internal  to  stub
  1787.         areas.
  1788.  
  1789.  
  1790.  
  1791.  
  1792. [Moy]                                                          [Page 32]
  1793.  
  1794. Internet Draft               OSPF Version 2                November 1992
  1795.  
  1796.  
  1797.     3.7.  Partitions of areas
  1798.  
  1799.         OSPF does not actively attempt to repair area partitions.   When
  1800.         an  area  becomes  partitioned,  each component simply becomes a
  1801.         separate area.  The backbone then performs routing  between  the
  1802.         new  areas.   Some destinations reachable via intra-area routing
  1803.         before the partition will now require inter-area routing.
  1804.  
  1805.         In the previous section, an area was  described  as  a  list  of
  1806.         address ranges.  Any particular address range must still be com-
  1807.         pletely contained in a single component of the  area  partition.
  1808.         This  has to do with the way the area contents are summarized to
  1809.         the backbone.  Also, the backbone itself must not partition.  If
  1810.         it does, parts of the Autonomous System will become unreachable.
  1811.         Backbone partitions can be repaired by configuring virtual links
  1812.         (see Section 15).
  1813.  
  1814.         Another way to think about area partitions is  to  look  at  the
  1815.         Autonomous  System graph that was introduced in Section 2.  Area
  1816.         IDs can be viewed as colors for the graph's edges.[1] Each  edge
  1817.         of  the  graph  connects  to a network, or is itself a point-to-
  1818.         point network.  In either case, the edge  is  colored  with  the
  1819.         network's Area ID.
  1820.  
  1821.         A group of edges, all having the same color, and  interconnected
  1822.         by  vertices,  represents an area.  If the topology of the Auto-
  1823.         nomous System is intact, the graph will have several regions  of
  1824.         color, each color being a distinct Area ID.
  1825.  
  1826.         When the AS topology changes, one of the areas may become parti-
  1827.         tioned.   The graph of the AS will then have multiple regions of
  1828.         the same color (Area ID).  The routing in the Autonomous  System
  1829.         will continue to function as long as these regions of same color
  1830.         are connected by the single backbone region.
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. [Moy]                                                          [Page 33]
  1849.  
  1850. Internet Draft               OSPF Version 2                November 1992
  1851.  
  1852.  
  1853. 4.  Functional Summary
  1854.  
  1855.     A separate copy of OSPF's basic routing algorithm runs in each area.
  1856.     Routers  having  interfaces to multiple areas run multiple copies of
  1857.     the algorithm.  A brief summary of the routing algorithm follows.
  1858.  
  1859.     When a router starts, it first initializes the routing protocol data
  1860.     structures.   The  router then waits for indications from the lower-
  1861.     level protocols that its interfaces are functional.
  1862.  
  1863.     A router then uses the OSPF's Hello Protocol to  acquire  neighbors.
  1864.     The  router  sends  Hello  packets  to  its  neighbors,  and in turn
  1865.     receives their Hello packets.  On broadcast and point-to-point  net-
  1866.     works,  the  router  dynamically  detects its neighboring routers by
  1867.     sending its Hello packets to the  multicast  address  AllSPFRouters.
  1868.     On  non-broadcast networks, some configuration information is neces-
  1869.     sary in order to discover neighbors.  On all  multi-access  networks
  1870.     (broadcast  or  non-broadcast),  the  Hello  Protocol  also elects a
  1871.     Designated router for the network.
  1872.  
  1873.     The router will attempt to form adjacencies with some of  its  newly
  1874.     acquired  neighbors.  Topological databases are synchronized between
  1875.     pairs of adjacent routers.  On multi-access networks, the Designated
  1876.     Router determines which routers should become adjacent.
  1877.  
  1878.     Adjacencies control the distribution of  routing  protocol  packets.
  1879.     Routing  protocol packets are sent and received only on adjacencies.
  1880.     In particular, distribution of topological database updates proceeds
  1881.     along adjacencies.
  1882.  
  1883.     A router periodically advertises its state,  which  is  also  called
  1884.     link  state.   Link  state  is also advertised when a router's state
  1885.     changes.  A router's adjacencies are reflected in  the  contents  of
  1886.     its  link  state advertisements.  This relationship between adjacen-
  1887.     cies and link state allows the protocol to detect dead routers in  a
  1888.     timely fashion.
  1889.  
  1890.     Link state advertisements are  flooded  throughout  the  area.   The
  1891.     flooding algorithm is reliable, ensuring that all routers in an area
  1892.     have exactly the same topological database.  This database  consists
  1893.     of  the  collection  of link state advertisements received from each
  1894.     router belonging to the area.  From this database each router calcu-
  1895.     lates a shortest-path tree, with itself as root.  This shortest-path
  1896.     tree in turn yields a routing table for the protocol.
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904. [Moy]                                                          [Page 34]
  1905.  
  1906. Internet Draft               OSPF Version 2                November 1992
  1907.  
  1908.  
  1909.     4.1.  Inter-area routing
  1910.  
  1911.         The previous section described the  operation  of  the  protocol
  1912.         within  a single area.  For intra-area routing, no other routing
  1913.         information is pertinent.  In order to be able to route to  des-
  1914.         tinations  outside  of  the area, the area border routers inject
  1915.         additional routing information into the area.   This  additional
  1916.         information  is  a  distillation  of  the rest of the Autonomous
  1917.         System's topology.
  1918.  
  1919.         This distillation is accomplished as follows: Each  area  border
  1920.         router  is  by  definition connected to the backbone.  Each area
  1921.         border router summarizes the topology of its attached areas  for
  1922.         transmission on the backbone, and hence to all other area border
  1923.         routers.  A area border router  then  has  complete  topological
  1924.         information concerning the backbone, and the area summaries from
  1925.         each of the other area border routers.  From  this  information,
  1926.         the router calculates paths to all destinations not contained in
  1927.         its attached areas.  The router then advertises these  paths  to
  1928.         its attached areas.  This enables the area's internal routers to
  1929.         pick the best exit router when forwarding  traffic  to  destina-
  1930.         tions in other areas.
  1931.  
  1932.  
  1933.     4.2.  AS external routes
  1934.  
  1935.         Routers that have information regarding other Autonomous Systems
  1936.         can  flood  this  information  throughout the AS.  This external
  1937.         routing information is distributed verbatim to every participat-
  1938.         ing  router.   There is one exception: external routing informa-
  1939.         tion is not flooded into "stub" areas (see Section 3.6).
  1940.  
  1941.         To utilize external routing information, the path to all routers
  1942.         advertising external information must be known throughout the AS
  1943.         (excepting the stub areas).  For that reason, the  locations  of
  1944.         these  AS boundary routers are summarized by the (non-stub) area
  1945.         border routers.
  1946.  
  1947.  
  1948.     4.3.  Routing protocol packets
  1949.  
  1950.         The OSPF protocol runs directly over IP, using IP  protocol  89.
  1951.         OSPF does not provide any explicit fragmentation/reassembly sup-
  1952.         port.      When     fragmentation     is      necessary,      IP
  1953.         fragmentation/reassembly  is  used.   OSPF protocol packets have
  1954.         been designed so that large protocol packets  can  generally  be
  1955.         split  into  several smaller protocol packets.  This practice is
  1956.         recommended;  IP  fragmentation  should  be   avoided   whenever
  1957.  
  1958.  
  1959.  
  1960. [Moy]                                                          [Page 35]
  1961.  
  1962. Internet Draft               OSPF Version 2                November 1992
  1963.  
  1964.  
  1965.         possible.
  1966.  
  1967.         Routing protocol packets should always be sent with the  IP  TOS
  1968.         field  set  to  0.  If at all possible, routing protocol packets
  1969.         should be given preference over regular IP  data  traffic,  both
  1970.         when  being sent and received.  As an aid to accomplishing this,
  1971.         OSPF protocol packets should have their IP precedence field  set
  1972.         to the value Internetwork Control (see [RFC 791]).
  1973.  
  1974.         All OSPF protocol packets share a common protocol header that is
  1975.         described in Appendix A.  The OSPF packet types are listed below
  1976.         in Table 8.  Their formats are also described in Appendix A.
  1977.  
  1978.  
  1979.  
  1980.              Type   Packet  name           Protocol  function
  1981.              __________________________________________________________
  1982.              1      Hello                  Discover/maintain  neighbors
  1983.              2      Database Description   Summarize database contents
  1984.              3      Link State Request     Database download
  1985.              4      Link State Update      Database update
  1986.              5      Link State Ack         Flooding acknowledgment
  1987.  
  1988.  
  1989.                             Table 8: OSPF packet types.
  1990.  
  1991.  
  1992.         OSPF's Hello protocol uses Hello packets to discover  and  main-
  1993.         tain  neighbor relationships.  The Database Description and Link
  1994.         State Request packets are used in the  forming  of  adjacencies.
  1995.         OSPF's  reliable  update  mechanism  is  implemented by the Link
  1996.         State Update and Link State Acknowledgment packets.
  1997.  
  1998.         Each Link State Update packet carries a set of  new  link  state
  1999.         advertisements one hop further away from their point of origina-
  2000.         tion.  A single Link State Update packet may  contain  the  link
  2001.         state  advertisements of several routers.  Each advertisement is
  2002.         tagged with the ID of the originating router and a  checksum  of
  2003.         its  link state contents.  The five different types of OSPF link
  2004.         state advertisements are listed below in Table 9.
  2005.  
  2006.         As mentioned above, OSPF routing packets (with the exception  of
  2007.         Hellos)  are  sent  only over adjacencies.  Note that this means
  2008.         that all protocol packets travel a single IP hop,  except  those
  2009.         that  are  sent over virtual adjacencies.  The IP source address
  2010.         of an OSPF protocol packet is one end of a router adjacency, and
  2011.         the  IP destination address is either the other end of the adja-
  2012.         cency or an IP multicast address.
  2013.  
  2014.  
  2015.  
  2016. [Moy]                                                          [Page 36]
  2017.  
  2018. Internet Draft               OSPF Version 2                November 1992
  2019.  
  2020.  
  2021.  
  2022.  
  2023.          LS     Advertisement   Advertisement description
  2024.          type   name
  2025.          _____________________________________________________
  2026.          1      Router links    Originated by all routers.
  2027.                 advs.           This advertisement describes
  2028.                                 the collected states of the
  2029.                                 router's interfaces to an
  2030.                                 area. Flooded throughout a
  2031.                                 single area only.
  2032.          _____________________________________________________
  2033.          2      Network links   Originated for multi-access
  2034.                 advs.           networks by the Designated
  2035.                                 Router. This advertisement
  2036.                                 contains the list of routers
  2037.                                 connected to the network.
  2038.                                 Flooded throughout a single
  2039.                                 area only.
  2040.          _____________________________________________________
  2041.          3,4    Summary link    Originated by area border
  2042.                 advs.           routers, and flooded through-
  2043.                                 out their associated area.
  2044.                                 Each summary link advertise-
  2045.                                 ment describes a route to a
  2046.                                 destination outside the area,
  2047.                                 yet still inside the AS (i.e.,
  2048.                                 an inter-area route). Type 3
  2049.                                 advertisements describe routes
  2050.                                 to networks. Type 4 advertise-
  2051.                                 ments describe routes to AS
  2052.                                 boundary routers.
  2053.          _____________________________________________________
  2054.          5      AS external     Originated by AS boundary
  2055.                 link advs.      routers, and flooded through-
  2056.                                 out the AS. Each external
  2057.                                 advertisement describes a
  2058.                                 route to a destination in
  2059.                                 another Autonomous System.
  2060.                                 Default routes for the AS can
  2061.                                 also be described by AS
  2062.                                 external advertisements.
  2063.  
  2064.  
  2065.                 Table 9: OSPF link state advertisements.
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072. [Moy]                                                          [Page 37]
  2073.  
  2074. Internet Draft               OSPF Version 2                November 1992
  2075.  
  2076.  
  2077.     4.4.  Basic implementation requirements
  2078.  
  2079.         An implementation of OSPF requires the following pieces of  sys-
  2080.         tem support:
  2081.  
  2082.  
  2083.         Timers
  2084.             Two different kind of timers are required.  The first  kind,
  2085.             called  single  shot  timers, fire once and cause a protocol
  2086.             event to be processed.  The  second  kind,  called  interval
  2087.             timers,  fire  at  continuous intervals.  These are used for
  2088.             the sending of packets at regular intervals.  A good example
  2089.             of this is the regular broadcast of Hello packets (on broad-
  2090.             cast networks).  The granularity of both kinds of timers  is
  2091.             one second.
  2092.  
  2093.             Interval timers should be implemented to  avoid  drift.   In
  2094.             some  router  implementations,  packet processing can affect
  2095.             timer execution.  When multiple routers are  attached  to  a
  2096.             single  network,  all doing broadcasts, this can lead to the
  2097.             synchronization  of  routing  packets   (which   should   be
  2098.             avoided).   If  timers cannot be implemented to avoid drift,
  2099.             small random amounts should be added to/subtracted from  the
  2100.             timer interval at each firing.
  2101.  
  2102.         IP multicast
  2103.             Certain OSPF packets use IP multicast.  Support for  receiv-
  2104.             ing  and  sending  IP multicasts, along with the appropriate
  2105.             lower-level protocol support, is required.  These IP  multi-
  2106.             cast  packets  never travel more than one hop.  For informa-
  2107.             tion on IP multicast, see [RFC 1112].
  2108.  
  2109.         Variable-length subnet support
  2110.             The router's IP protocol support must include the ability to
  2111.             divide a single IP class A, B, or C network number into many
  2112.             subnets  of  various  sizes.   This   is   commonly   called
  2113.             variable-length subnetting; see Section 3.5 for details.
  2114.  
  2115.         Lower-level protocol support
  2116.             The lower level protocols referred to here are  the  network
  2117.             access  protocols,  such  as  the  Ethernet data link layer.
  2118.             Indications must be passed from from these protocols to OSPF
  2119.             as  the network interface goes up and down.  For example, on
  2120.             an ethernet it would be valuable to know when  the  ethernet
  2121.             transceiver cable becomes unplugged.
  2122.  
  2123.         Non-broadcast lower-level protocol support
  2124.             Remember  that  non-broadcast  networks   are   multi-access
  2125.  
  2126.  
  2127.  
  2128. [Moy]                                                          [Page 38]
  2129.  
  2130. Internet Draft               OSPF Version 2                November 1992
  2131.  
  2132.  
  2133.             networks  such  as a X.25 PDN.  On these networks, the Hello
  2134.             Protocol can be aided by providing  an  indication  to  OSPF
  2135.             when  an  attempt is made to send a packet to a dead or non-
  2136.             existent router.  For example, on a PDN a dead router may be
  2137.             indicated by the reception of a X.25 clear with an appropri-
  2138.             ate cause and diagnostic,  and  this  information  would  be
  2139.             passed to OSPF.
  2140.  
  2141.         List manipulation primitives
  2142.             Much of the OSPF functionality is described in terms of  its
  2143.             operation  on lists of link state advertisements.  For exam-
  2144.             ple, the advertisements that will  be  retransmitted  to  an
  2145.             adjacent  router until acknowledged are described as a list.
  2146.             Any particular advertisement may be on many such lists.   An
  2147.             OSPF  implementation  needs  to  be able to manipulate these
  2148.             lists, adding and  deleting  constituent  advertisements  as
  2149.             necessary.
  2150.  
  2151.         Tasking support
  2152.             Certain procedures described in  this  specification  invoke
  2153.             other  procedures.   At times, these other procedures should
  2154.             be executed in-line, that is, before the  current  procedure
  2155.             is  finished.  This is indicated in the text by instructions
  2156.             to execute a procedure.  At  other  times,  the  other  pro-
  2157.             cedures  are  to be executed only when the current procedure
  2158.             has finished.  This is indicated by instructions to schedule
  2159.             a task.
  2160.  
  2161.  
  2162.     4.5.  Optional OSPF capabilities
  2163.  
  2164.         The OSPF protocol  defines  several  optional  capabilities.   A
  2165.         router  indicates  the optional capabilities that it supports in
  2166.         its OSPF Hello packets, Database Description packets and in  its
  2167.         link  state  advertisements.   This enables routers supporting a
  2168.         mix of optional capabilities to coexist in a  single  Autonomous
  2169.         System.
  2170.  
  2171.         Some capabilities must be supported by all routers attached to a
  2172.         specific  area.   In  this  case,  a  router  will  not accept a
  2173.         neighbor's Hello unless there is a match in  reported  capabili-
  2174.         ties  (i.e., a capability mismatch prevents a neighbor relation-
  2175.         ship from forming).  An example of this is the external  routing
  2176.         capability (see below).
  2177.  
  2178.         Other capabilities can be negotiated during  the  database  syn-
  2179.         chronization  process.   This  is accomplished by specifying the
  2180.         optional  capabilities  in  Database  Description  packets.    A
  2181.  
  2182.  
  2183.  
  2184. [Moy]                                                          [Page 39]
  2185.  
  2186. Internet Draft               OSPF Version 2                November 1992
  2187.  
  2188.  
  2189.         capability  mismatch with a neighbor is this case will result in
  2190.         only a subset  of  link  state  advertisements  being  exchanged
  2191.         between the two neighbors.
  2192.  
  2193.         The routing table build process can  also  be  affected  by  the
  2194.         presence/absence  of  optional capabilities.  For example, since
  2195.         the optional capabilities are reported in link state  advertise-
  2196.         ments,  routers  incapable  of  certain functions can be avoided
  2197.         when building the shortest path tree.  An example of this is the
  2198.         TOS routing capability (see below).
  2199.  
  2200.         The current OSPF optional capabilities are  listed  below.   See
  2201.         Section A.2 for more information.
  2202.  
  2203.  
  2204.         External routing capability
  2205.             Entire OSPF areas can be configured as "stubs" (see  Section
  2206.             3.6).   AS  external advertisements will not be flooded into
  2207.             stub areas.  This capability is represented by the E-bit  in
  2208.             the  OSPF  options  field  (see  Section  A.2).  In order to
  2209.             ensure consistent configuration of stub areas,  all  routers
  2210.             interfacing  to  such  an  area must have the E-bit clear in
  2211.             their Hello packets (see Sections 9.5 and 10.5).
  2212.  
  2213.         TOS capability
  2214.             All OSPF implementations must be able to calculate  separate
  2215.             routes  based on IP Type of Service.  However, to save rout-
  2216.             ing table space and processing resources, an OSPF router can
  2217.             be  configured  to  ignore  TOS when forwarding packets.  In
  2218.             this case, the router calculates  routes  for  TOS  0  only.
  2219.             This  capability  is  represented  by  the T-bit in the OSPF
  2220.             options field (see Section A.2).  TOS-capable  routers  will
  2221.             attempt  to  avoid  non-TOS-capable routers when calculating
  2222.             non-zero TOS paths.
  2223.  
  2224.  
  2225. 5.  Protocol Data Structures
  2226.  
  2227.     The OSPF protocol is described in this specification in terms of its
  2228.     operation  on  various protocol data structures.  The following list
  2229.     comprises the top-level OSPF data  structures.   Any  initialization
  2230.     that  needs  to be done is noted.  Areas, OSPF interfaces and neigh-
  2231.     bors also have associated data structures that are  described  later
  2232.     in this specification.
  2233.  
  2234.  
  2235.     Router ID
  2236.         a 32-bit number that uniquely identifies this router in the  AS.
  2237.  
  2238.  
  2239.  
  2240. [Moy]                                                          [Page 40]
  2241.  
  2242. Internet Draft               OSPF Version 2                November 1992
  2243.  
  2244.  
  2245.         One  possible  implementation strategy would be to use the smal-
  2246.         lest IP interface address belonging to the router.
  2247.  
  2248.     Area structures
  2249.         Each one of the areas to which the router is connected  has  its
  2250.         own  data  structure.  This data structure describes the working
  2251.         of the basic algorithm.  Remember that each area runs a separate
  2252.         copy of the basic algorithm.
  2253.  
  2254.     Backbone (area) structure
  2255.         The basic algorithm operates on the backbone as if  it  were  an
  2256.         area.   For  this  reason the backbone is represented as an area
  2257.         structure.
  2258.  
  2259.     Virtual links configured
  2260.         The virtual links configured with this router as  one  endpoint.
  2261.         In  order  to  have  configured virtual links, the router itself
  2262.         must be an area border router.  Virtual links are identified  by
  2263.         the  Router  ID  of  the other endpoint -- which is another area
  2264.         border router.  These two endpoint routers must be attached to a
  2265.         common  area,  called  the virtual link's transit area.  Virtual
  2266.         links are part of the backbone,  and  behave  as  if  they  were
  2267.         unnumbered  point-to-point  networks between the two routers.  A
  2268.         virtual link uses the intra-area routing of its transit area  to
  2269.         forward  packets.  Virtual links are brought up and down through
  2270.         the building of the shortest-path trees for the transit area.
  2271.  
  2272.     List of external routes
  2273.         These are routes to destinations external to the Autonomous Sys-
  2274.         tem, that have been gained either through direct experience with
  2275.         another routing protocol (such as EGP), or through configuration
  2276.         information,  or through a combination of the two (e.g., dynamic
  2277.         external information to be advertised by  OSPF  with  configured
  2278.         metric). Any router having these external routes is called an AS
  2279.         boundary router.  These routes are advertised by the router into
  2280.         the OSPF routing domain via AS external link advertisements.
  2281.  
  2282.     List of AS external link advertisements
  2283.         Part of the topological database.  These  have  have  originated
  2284.         from  the AS boundary routers.  They comprise routes to destina-
  2285.         tions external to the Autonomous  System.   Note  that,  if  the
  2286.         router  is itself an AS boundary router, some of these AS exter-
  2287.         nal link advertisements have been self originated.
  2288.  
  2289.     The routing table
  2290.         Derived from the topological database.   Each  destination  that
  2291.         the  router can forward to is represented by a cost and a set of
  2292.         paths.  A path is described by its type and next hop.  For  more
  2293.  
  2294.  
  2295.  
  2296. [Moy]                                                          [Page 41]
  2297.  
  2298. Internet Draft               OSPF Version 2                November 1992
  2299.  
  2300.  
  2301.         information, see Section 11.
  2302.  
  2303.     TOS capability
  2304.         This item indicates whether the router will  calculate  separate
  2305.         routes  based  on  TOS.   This is a configurable parameter.  For
  2306.         more information, see Sections 4.5 and 16.9.
  2307.  
  2308.  
  2309.     Figure 9 shows the collection of data structures present in a  typi-
  2310.     cal  router.  The router pictured is RT10, from the map in Figure 6.
  2311.     Note that router RT10 has a virtual link configured to router  RT11,
  2312.     with  Area  2  as the link's transit area.  This is indicated by the
  2313.     dashed line in Figure 9.  When  the  virtual  link  becomes  active,
  2314.     through  the  building  of  the  shortest  path  tree for Area 2, it
  2315.     becomes an interface to the backbone (see the  two  backbone  inter-
  2316.     faces depicted in Figure 9).
  2317.  
  2318. 6.  The Area Data Structure
  2319.  
  2320.     The area data structure contains all the information used to run the
  2321.     basic  routing  algorithm.  Each  area maintains its own topological
  2322.     database. A network belongs to a single area, and a router interface
  2323.     connects  to  a single area. Each router adjacency also belongs to a
  2324.     single area.
  2325.  
  2326.     The OSPF backbone has all the properties of an area.  For that  rea-
  2327.     son  it  is  also  represented by an area data structure.  Note that
  2328.     some items in the structure apply differently to the  backbone  than
  2329.     to non-backbone areas.
  2330.  
  2331.     The area topological (or link state) database consists of  the  col-
  2332.     lection  of router links, network links and summary links advertise-
  2333.     ments that have originated from the area's routers.   This  informa-
  2334.     tion  is  flooded  throughout  a  single  area only.  The list of AS
  2335.     external link advertisements (see Section 5) is also  considered  to
  2336.     be part of each area's topological database.
  2337.  
  2338.  
  2339.     Area ID
  2340.         A 32-bit number identifying the area.  0  is  reserved  for  the
  2341.         Area  ID  of  the  backbone.  If assigning subnetted networks as
  2342.         separate areas, the IP network number could be used as the  Area
  2343.         ID.
  2344.  
  2345.     List of component address ranges
  2346.         The address ranges that define the area.  Each address range  is
  2347.         specified  by  an [address,mask] pair and a status indication of
  2348.         either Advertise or DoNotAdvertise (see Section  12..4.3).  Each
  2349.  
  2350.  
  2351.  
  2352. [Moy]                                                          [Page 42]
  2353.  
  2354. Internet Draft               OSPF Version 2                November 1992
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.                               +----+
  2361.                               |RT10|------+
  2362.                               +----+       \+-------------+
  2363.                              /      \       |Routing Table|
  2364.                             /        \      +-------------+
  2365.                            /          \
  2366.               +------+    /            \    +--------+
  2367.               |Area 2|---+              +---|Backbone|
  2368.               +------+***********+          +--------+
  2369.              /        \           *        /          \
  2370.             /          \           *      /            \
  2371.        +---------+  +---------+    +------------+       +------------+
  2372.        |Interface|  |Interface|    |Virtual Link|       |Interface Ib|
  2373.        |  to N6  |  |  to N8  |    |   to RT11  |       +------------+
  2374.        +---------+  +---------+    +------------+             |
  2375.            /  \           |               |                   |
  2376.           /    \          |               |                   |
  2377.    +--------+ +--------+  |        +-------------+      +------------+
  2378.    |Neighbor| |Neighbor|  |        |Neighbor RT11|      |Neighbor RT6|
  2379.    |  RT8   | |  RT7   |  |        +-------------+      +------------+
  2380.    +--------+ +--------+  |
  2381.                           |
  2382.                      +-------------+
  2383.                      |Neighbor RT11|
  2384.                      +-------------+
  2385.  
  2386.  
  2387.                 Figure 9: Router RT10's Data structures
  2388.  
  2389.         network is then assigned to an area  depending  on  the  address
  2390.         range  that  it  falls  into  (specified  address ranges are not
  2391.         allowed to overlap).  As an example, if an IP subnetted  network
  2392.         is to be its own separate OSPF area, the area is defined to con-
  2393.         sist of a single address range - an IP network number  with  its
  2394.         natural (class A, B or C) mask.
  2395.  
  2396.     Associated router interfaces
  2397.         This router's interfaces  connecting  to  the  area.   A  router
  2398.         interface  belongs  to  one and only one area (or the backbone).
  2399.         For the backbone structure this list includes  all  the  virtual
  2400.         links.   A  virtual  link  is identified by the router ID of its
  2401.         other endpoint; its cost is the cost of the shortest  intra-area
  2402.         path that exists between the two routers.
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408. [Moy]                                                          [Page 43]
  2409.  
  2410. Internet Draft               OSPF Version 2                November 1992
  2411.  
  2412.  
  2413.     List of router links advertisements
  2414.         A router links advertisement is generated by each router in  the
  2415.         area.   It describes the state of the router's interfaces to the
  2416.         area.
  2417.  
  2418.     List of network links advertisements
  2419.         One network links advertisement is generated  for  each  transit
  2420.         multi-access network in the area.  A network links advertisement
  2421.         describes the set of routers currently connected to the network.
  2422.  
  2423.     List of summary links advertisements
  2424.         Summary link  advertisements  originate  from  the  area's  area
  2425.         border  routers.   They describe routes to destinations internal
  2426.         to the Autonomous System, yet external to the area.
  2427.  
  2428.     Shortest-path tree
  2429.         The shortest-path tree for the area, with this router itself  as
  2430.         root.  Derived from the collected router links and network links
  2431.         advertisements by the Dijkstra algorithm (see Section 16.1).
  2432.  
  2433.     Authentication type
  2434.         The type of authentication used for this  area.   Authentication
  2435.         types  are defined in Appendix D.  All OSPF packet exchanges are
  2436.         authenticated.  Different authentication schemes may be used  in
  2437.         different areas.
  2438.  
  2439.     Transit capability
  2440.         Set to TRUE if and only if there are one or more active  virtual
  2441.         links  using  the  area  as  a  transit area. Equivalently, this
  2442.         parameter indicates whether the area can carry data traffic that
  2443.         neither  originates  nor  terminates  in  the  area itself. This
  2444.         parameter is calculated when the area's  shortest-path  tree  is
  2445.         built (see Section 16.1, and is used as an input to a subsequent
  2446.         step of the routing table build process (see Section 16.3).
  2447.  
  2448.     External routing capability
  2449.         Whether   AS   external   advertisements   will    be    flooded
  2450.         into/throughout the area.  This is a configurable parameter.  If
  2451.         AS external advertisements are excluded from the area, the  area
  2452.         is  called  a  "stub".   Internal  to  stub areas, routing to AS
  2453.         external destinations will be based solely on a default  summary
  2454.         route.  The backbone cannot be configured as a stub area.  Also,
  2455.         virtual links cannot be configured through stub areas.  For more
  2456.         information, see Section 3.6.
  2457.  
  2458.     StubDefaultCost
  2459.         If the area has been configured as a stub area, and  the  router
  2460.         itself  is  an  area  border  router,  then  the StubDefaultCost
  2461.  
  2462.  
  2463.  
  2464. [Moy]                                                          [Page 44]
  2465.  
  2466. Internet Draft               OSPF Version 2                November 1992
  2467.  
  2468.  
  2469.         indicates the cost of the default summary link that  the  router
  2470.         should  advertise  into  the area.  There can be a separate cost
  2471.         configured for each IP TOS.  See Section 12.4.3 for more  infor-
  2472.         mation.
  2473.  
  2474.  
  2475.     Unless otherwise specified, the remaining sections of this  document
  2476.     refer to the operation of the protocol in a single area.
  2477.  
  2478.  
  2479. 7.  Bringing Up Adjacencies
  2480.  
  2481.     OSPF creates adjacencies between neighboring routers for the purpose
  2482.     of  exchanging  routing  information.   Not  every  two  neighboring
  2483.     routers will become adjacent.  This section covers the  generalities
  2484.     involved  in creating adjacencies.  For further details consult Sec-
  2485.     tion 10.
  2486.  
  2487.  
  2488.     7.1.  The Hello Protocol
  2489.  
  2490.         The Hello Protocol is responsible for establishing and maintain-
  2491.         ing  neighbor relationships.  It also ensures that communication
  2492.         between neighbors is  bidirectional.   Hello  packets  are  sent
  2493.         periodically  out all router interfaces.  Bidirectional communi-
  2494.         cation is indicated when the router sees itself  listed  in  the
  2495.         neighbor's Hello Packet.
  2496.  
  2497.         On multi-access networks, the Hello Protocol elects a Designated
  2498.         Router  for  the  network.   Among  other things, the Designated
  2499.         Router controls what adjacencies will be formed over the network
  2500.         (see below).
  2501.  
  2502.         The Hello Protocol works differently on broadcast  networks,  as
  2503.         compared to non-broadcast networks.  On broadcast networks, each
  2504.         router advertises  itself  by  periodically  multicasting  Hello
  2505.         Packets.   This  allows  neighbors to be discovered dynamically.
  2506.         These Hello Packets contain the router's view of the  Designated
  2507.         Router's  identity,  and  the  list of routers whose Hellos have
  2508.         been seen recently.
  2509.  
  2510.         On non-broadcast  networks  some  configuration  information  is
  2511.         necessary  for the operation of the Hello Protocol.  Each router
  2512.         that may potentially become Designated Router has a list of  all
  2513.         other  routers attached to the network.  A router, having Desig-
  2514.         nated Router potential, sends  hellos  to  all  other  potential
  2515.         Designated  Routers when its interface to the non-broadcast net-
  2516.         work first becomes operational.  This is an attempt to find  the
  2517.  
  2518.  
  2519.  
  2520. [Moy]                                                          [Page 45]
  2521.  
  2522. Internet Draft               OSPF Version 2                November 1992
  2523.  
  2524.  
  2525.         Designated  Router  for  the  network.   If the router itself is
  2526.         elected Designated Router, it begins sending hellos to all other
  2527.         routers attached to the network.
  2528.  
  2529.         After a neighbor has been discovered,  bidirectional  communica-
  2530.         tion  ensured,  and  (if on a multi-access network) a Designated
  2531.         Router elected, a decision is made regarding whether or  not  an
  2532.         adjacency should be formed with the neighbor (see Section 10.4).
  2533.         An attempt is always made to establish adjacencies  over  point-
  2534.         to-point networks and virtual links.  The first step in bringing
  2535.         up an adjacency is to  synchronize  the  neighbors'  topological
  2536.         databases.  This is covered in the next section.
  2537.  
  2538.  
  2539.     7.2.  The Synchronization of Databases
  2540.  
  2541.         In an SPF-based routing algorithm, it is very important for  all
  2542.         routers'  topological databases to stay synchronized.  OSPF sim-
  2543.         plifies this by requiring only adjacent routers to  remain  syn-
  2544.         chronized.   The  synchronization  process begins as soon as the
  2545.         routers  attempt  to  bring  up  the  adjacency.   Each   router
  2546.         describes  its  database  by  sending  a  sequence  of  Database
  2547.         Description packets to its neighbor.  Each Database  Description
  2548.         Packet describes a set of link state advertisements belonging to
  2549.         the database.  When the neighbor sees a link state advertisement
  2550.         that  is more recent than its own database copy, it makes a note
  2551.         that this newer advertisement should be requested.
  2552.  
  2553.         This sending and receiving of Database  Description  packets  is
  2554.         called  the  "Database  Exchange Process".  During this process,
  2555.         the two routers form a master/slave relationship.  Each Database
  2556.         Description  Packet has a sequence number.  Database Description
  2557.         Packets sent by the master (polls) are acknowledged by the slave
  2558.         through  echoing  of  the sequence number.  Both polls and their
  2559.         responses contain summaries of link state data.  The  master  is
  2560.         the only one allowed to retransmit Database Description Packets.
  2561.         It does so only at fixed intervals, the length of which  is  the
  2562.         configured constant RxmtInterval.
  2563.  
  2564.         Each Database Description contains an indication that there  are
  2565.         more  packets  to  follow  --- the M-bit.  The Database Exchange
  2566.         Process is over when a router has  received  and  sent  Database
  2567.         Description Packets with the M-bit off.
  2568.  
  2569.         During and after the Database Exchange Process, each router  has
  2570.         a list of those link state advertisements for which the neighbor
  2571.         has  more  up-to-date  instances.   These   advertisements   are
  2572.         requested  in  Link  State  Request Packets.  Link State Request
  2573.  
  2574.  
  2575.  
  2576. [Moy]                                                          [Page 46]
  2577.  
  2578. Internet Draft               OSPF Version 2                November 1992
  2579.  
  2580.  
  2581.         packets that are not satisfied are retransmitted at fixed inter-
  2582.         vals  of  time RxmtInterval.  When the Database Description Pro-
  2583.         cess has completed and all Link State Requests have been  satis-
  2584.         fied,  the databases are deemed synchronized and the routers are
  2585.         marked fully adjacent.  At this  time  the  adjacency  is  fully
  2586.         functional  and  is  advertised  in  the two routers' link state
  2587.         advertisements.
  2588.  
  2589.         The adjacency is used by the flooding procedure as soon  as  the
  2590.         Database Exchange Process begins.  This simplifies database syn-
  2591.         chronization, and guarantees that it finishes in  a  predictable
  2592.         period of time.
  2593.  
  2594.  
  2595.     7.3.  The Designated Router
  2596.  
  2597.         Every multi-access network has a Designated Router.  The  Desig-
  2598.         nated  Router performs two main functions for the routing proto-
  2599.         col:
  2600.  
  2601.         o   The Designated Router originates a network links  advertise-
  2602.             ment on behalf of the network.  This advertisement lists the
  2603.             set of routers  (including  the  Designated  Router  itself)
  2604.             currently  attached  to  the network.  The Link State ID for
  2605.             this advertisement (see Section 12.1.4) is the IP  interface
  2606.             address of the Designated Router.  The IP network number can
  2607.             then be obtained by using the subnet/network mask.
  2608.  
  2609.         o   The Designated router becomes adjacent to all other  routers
  2610.             on  the  network.   Since  the link state databases are syn-
  2611.             chronized across adjacencies (through adjacency bring-up and
  2612.             then  the flooding procedure), the Designated Router plays a
  2613.             central part in the synchronization process.
  2614.  
  2615.  
  2616.         The Designated Router is  elected  by  the  Hello  Protocol.   A
  2617.         router's  Hello  Packet  contains  its Router Priority, which is
  2618.         configurable on a  per-interface  basis.   In  general,  when  a
  2619.         router's  interface  to  a  network first becomes functional, it
  2620.         checks to see whether there is currently a Designated Router for
  2621.         the  network.   If  there is, it accepts that Designated Router,
  2622.         regardless of its Router Priority.  (This  makes  it  harder  to
  2623.         predict  the identity of the Designated Router, but ensures that
  2624.         the Designated Router changes less often.  See  below.)   Other-
  2625.         wise,  the router itself becomes Designated Router if it has the
  2626.         highest Router Priority on the network.  A  more  detailed  (and
  2627.         more  accurate)  description  of  Designated  Router election is
  2628.         presented in Section 9.4.
  2629.  
  2630.  
  2631.  
  2632. [Moy]                                                          [Page 47]
  2633.  
  2634. Internet Draft               OSPF Version 2                November 1992
  2635.  
  2636.  
  2637.         The Designated Router is the endpoint of many  adjacencies.   In
  2638.         order  to optimize the flooding procedure on broadcast networks,
  2639.         the Designated Router multicasts its Link State  Update  Packets
  2640.         to the address AllSPFRouters, rather than sending separate pack-
  2641.         ets over each adjacency.
  2642.  
  2643.         Section  2  of  this  document  discusses  the  directed   graph
  2644.         representation of an area.  Router nodes are labelled with their
  2645.         Router ID.  Broadcast network nodes are actually  labelled  with
  2646.         the IP address of their Designated Router.  It follows that when
  2647.         the Designated Router changes, it appears as if the network node
  2648.         on  the  graph  is  replaced by an entirely new node.  This will
  2649.         cause the network and all its attached routers to originate  new
  2650.         link  state  advertisements.   Until  the  topological databases
  2651.         again converge, some temporary loss of connectivity may  result.
  2652.         This  may  result  in  ICMP  unreachable  messages being sent in
  2653.         response to data  traffic.   For  that  reason,  the  Designated
  2654.         Router  should  change  only  infrequently.   Router  Priorities
  2655.         should be configured so that the most  dependable  router  on  a
  2656.         network eventually becomes Designated Router.
  2657.  
  2658.  
  2659.     7.4.  The Backup Designated Router
  2660.  
  2661.         In order to make the  transition  to  a  new  Designated  Router
  2662.         smoother,  there  is  a Backup Designated Router for each multi-
  2663.         access network.  The Backup Designated Router is  also  adjacent
  2664.         to  all  routers  on  the network, and becomes Designated Router
  2665.         when the previous Designated Router fails.   If  there  were  no
  2666.         Backup  Designated  Router,  when a new Designated Router became
  2667.         necessary, new adjacencies would have to be formed  between  the
  2668.         router  and  all other routers attached to the network.  Part of
  2669.         the adjacency forming process is the synchronizing of  topologi-
  2670.         cal  databases,  which  can  potentially take quite a long time.
  2671.         During this time, the network would not be available for transit
  2672.         data  traffic.   The Backup Designated obviates the need to form
  2673.         these adjacencies, since they already  exist.   This  means  the
  2674.         period of disruption in transit traffic lasts only as long as it
  2675.         take to flood the new link state advertisements (which  announce
  2676.         the new Designated Router).
  2677.  
  2678.         The Backup Designated Router does not generate a  network  links
  2679.         advertisement  for the network.  (If it did, the transition to a
  2680.         new Designated Router would be even faster.  However, this is  a
  2681.         tradeoff between database size and speed of convergence when the
  2682.         Designated Router disappears.)
  2683.  
  2684.         The Backup Designated  Router  is  also  elected  by  the  Hello
  2685.  
  2686.  
  2687.  
  2688. [Moy]                                                          [Page 48]
  2689.  
  2690. Internet Draft               OSPF Version 2                November 1992
  2691.  
  2692.  
  2693.         Protocol.   Each  Hello  Packet  has  a field that specifies the
  2694.         Backup Designated Router for the network.
  2695.  
  2696.         In some steps of the flooding procedure, the  Backup  Designated
  2697.         Router  plays  a  passive role, letting the Designated Router do
  2698.         more of the work.  This cuts down on the amount of local routing
  2699.         traffic.  See Section 13.3 for more information.
  2700.  
  2701.  
  2702.     7.5.  The graph of adjacencies
  2703.  
  2704.         An adjacency is bound to the network that the two  routers  have
  2705.         in  common.   If  two  routers have multiple networks in common,
  2706.         they may have multiple adjacencies between them.
  2707.  
  2708.         One can picture the collection of adjacencies on  a  network  as
  2709.         forming  an  undirected graph.  The vertices consist of routers,
  2710.         with an edge joining two routers  if  they  are  adjacent.   The
  2711.         graph  of  adjacencies  describes  the  flow of routing protocol
  2712.         packets, and in particular Link State Updates, through the Auto-
  2713.         nomous System.
  2714.  
  2715.         Two graphs are possible, depending on whether the common network
  2716.         is  multi-access.  On physical point-to-point networks (and vir-
  2717.         tual links), the two routers joined by the network will be adja-
  2718.         cent  after  their  databases have been synchronized.  On multi-
  2719.         access networks, both  the  Designated  Router  and  the  Backup
  2720.         Designated  Router are adjacent to all other routers attached to
  2721.         the network, and these account for all adjacencies.
  2722.  
  2723.         These graphs are shown in Figure 10.  It is assumed that  router
  2724.         RT7  has become the Designated Router, and router RT3 the Backup
  2725.         Designated Router, for the network N2.   The  Backup  Designated
  2726.         Router  performs a lesser function during the flooding procedure
  2727.         than the Designated Router (see Section 13.3).  This is the rea-
  2728.         son for the dashed lines connecting the Backup Designated Router
  2729.         RT3.
  2730.  
  2731.  
  2732. 8.  Protocol Packet Processing
  2733.  
  2734.     This section discusses the general processing  of  routing  protocol
  2735.     packets.  It is very important that the router topological databases
  2736.     remain synchronized.  For  this  reason,  routing  protocol  packets
  2737.     should  get  preferential treatment over ordinary data packets, both
  2738.     in sending and receiving.
  2739.  
  2740.     Routing protocol packets are sent along adjacencies only  (with  the
  2741.  
  2742.  
  2743.  
  2744. [Moy]                                                          [Page 49]
  2745.  
  2746. Internet Draft               OSPF Version 2                November 1992
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.           +---+            +---+
  2753.           |RT1|------------|RT2|            o---------------o
  2754.           +---+    N1      +---+           RT1             RT2
  2755.  
  2756.  
  2757.  
  2758.                                                  RT7
  2759.                                                   o---------+
  2760.             +---+   +---+   +---+                /|\        |
  2761.             |RT7|   |RT3|   |RT4|               / | \       |
  2762.             +---+   +---+   +---+              /  |  \      |
  2763.               |       |       |               /   |   \     |
  2764.          +-----------------------+        RT5o RT6o    oRT4 |
  2765.                   |       |     N2            *   *   *     |
  2766.                 +---+   +---+                  *  *  *      |
  2767.                 |RT5|   |RT6|                   * * *       |
  2768.                 +---+   +---+                    ***        |
  2769.                                                   o---------+
  2770.                                                  RT3
  2771.  
  2772.  
  2773.                   Figure 10: The graph of adjacencies
  2774.  
  2775.     exception of Hello packets, which are used to discover the  adjacen-
  2776.     cies).  This means that all protocol packets travel a single IP hop,
  2777.     except those sent over virtual links.
  2778.  
  2779.     All routing protocol packets begin with a standard header.  The sec-
  2780.     tions below give the details on how to fill in and verify this stan-
  2781.     dard header.  Then, for each packet type, the section is listed that
  2782.     gives more details on that particular packet type's processing.
  2783.  
  2784.     8.1.  Sending protocol packets
  2785.  
  2786.         When a router sends a routing protocol packet, it fills  in  the
  2787.         fields  of that standard header as follows.  For more details on
  2788.         the header format consult Section A.3.1:
  2789.  
  2790.  
  2791.         Version #
  2792.             Set to 2, the version number of the protocol  as  documented
  2793.             in this specification.
  2794.  
  2795.         Packet type
  2796.             The type of OSPF packet, such as Link state Update or  Hello
  2797.  
  2798.  
  2799.  
  2800. [Moy]                                                          [Page 50]
  2801.  
  2802. Internet Draft               OSPF Version 2                November 1992
  2803.  
  2804.  
  2805.             Packet.
  2806.  
  2807.         Packet length
  2808.             The length of the entire OSPF packet in bytes, including the
  2809.             standard header.
  2810.  
  2811.         Router ID
  2812.             The identity of the router itself (who  is  originating  the
  2813.             packet).
  2814.  
  2815.         Area ID
  2816.             The area that the packet is being sent into.
  2817.  
  2818.         Checksum
  2819.             The standard IP 16-bit  one's  complement  checksum  of  the
  2820.             entire  OSPF  packet,  excluding  the  64-bit authentication
  2821.             field.  This checksum should be  calculated  before  handing
  2822.             the packet to the appropriate authentication procedure.
  2823.  
  2824.         Autype and Authentication
  2825.             Each OSPF packet exchange is authenticated.   Authentication
  2826.             types  are assigned by the protocol and documented in Appen-
  2827.             dix D.  A different authentication scheme can  be  used  for
  2828.             each  OSPF  area.  The 64-bit authentication field is set by
  2829.             the  appropriate  authentication  procedure  (determined  by
  2830.             Autype).   This  procedure  should  be  the last called when
  2831.             forming the packet to be sent.  The setting of the authenti-
  2832.             cation  field  is  determined by the packet contents and the
  2833.             authentication key (which is configurable on a per-interface
  2834.             basis).
  2835.  
  2836.  
  2837.         The IP destination address for the packet is  selected  as  fol-
  2838.         lows.   On  physical point-to-point networks, the IP destination
  2839.         is always set to the the address AllSPFRouters.   On  all  other
  2840.         network  types  (including  virtual links), the majority of OSPF
  2841.         packets are sent as unicasts, i.e., sent directly to  the  other
  2842.         end  of the adjacency.  In this case, the IP destination is just
  2843.         the neighbor IP address associated with the  other  end  of  the
  2844.         adjacency  (see  Section 10).  The only packets not sent as uni-
  2845.         casts are on broadcast networks; on these networks Hello packets
  2846.         are  sent to the multicast destination AllSPFRouters, the Desig-
  2847.         nated Router and its Backup send both Link State Update  Packets
  2848.         and  Link  State Acknowledgment Packets to the multicast address
  2849.         AllSPFRouters, while all other  routers  send  both  their  Link
  2850.         State Update and Link State Acknowledgment Packets to the multi-
  2851.         cast address AllDRouters.
  2852.  
  2853.  
  2854.  
  2855.  
  2856. [Moy]                                                          [Page 51]
  2857.  
  2858. Internet Draft               OSPF Version 2                November 1992
  2859.  
  2860.  
  2861.         Retransmissions of Link State Update packets are ALWAYS sent  as
  2862.         unicasts.
  2863.  
  2864.         The IP source address should be set to the  IP  address  of  the
  2865.         sending interface.  Interfaces to unnumbered point-to-point net-
  2866.         works have no associated IP address.  On these  interfaces,  the
  2867.         IP source should be set to any of the other IP addresses belong-
  2868.         ing to the router.  For this reason, there must be at least  one
  2869.         IP  address  assigned to the router.[2] Note that, for most pur-
  2870.         poses, virtual  links  act  precisely  the  same  as  unnumbered
  2871.         point-to-point  networks.   However, each virtual link does have
  2872.         an interface IP address (discovered  during  the  routing  table
  2873.         build process) which is used as the IP source when sending pack-
  2874.         ets over the virtual link.
  2875.  
  2876.         For more information on the format  of  specific  packet  types,
  2877.         consult the sections listed in Table 10.
  2878.  
  2879.  
  2880.  
  2881.              Type   Packet name            detailed section (transmit)
  2882.              _________________________________________________________
  2883.              1      Hello                  Section  9.5
  2884.              2      Database description   Section 10.8
  2885.              3      Link state request     Section 10.9
  2886.              4      Link state update      Section 13.3
  2887.              5      Link state ack         Section 13.5
  2888.  
  2889.  
  2890.                  Table 10: Sections describing packet transmission.
  2891.  
  2892.  
  2893.  
  2894.     8.2.  Receiving protocol packets
  2895.  
  2896.         Whenever a protocol packet is  received  by  the  router  it  is
  2897.         marked  with the interface it was received on.  For routers that
  2898.         have virtual links configured, it may not be immediately obvious
  2899.         which interface to associate the packet with.  For example, con-
  2900.         sider the router RT11 depicted in Figure 6.  If RT11 receives an
  2901.         OSPF protocol packet on its interface to network N8, it may want
  2902.         to associate the packet with the interface to area  2,  or  with
  2903.         the virtual link to router RT10 (which is part of the backbone).
  2904.         In the following, we assume that the packet is initially associ-
  2905.         ated with the non-virtual  link.[3]
  2906.  
  2907.         In order for the packet to be accepted at the IP level, it  must
  2908.         pass a number of tests, even before the packet is passed to OSPF
  2909.  
  2910.  
  2911.  
  2912. [Moy]                                                          [Page 52]
  2913.  
  2914. Internet Draft               OSPF Version 2                November 1992
  2915.  
  2916.  
  2917.         for processing:
  2918.  
  2919.  
  2920.         o   The IP checksum must be correct.
  2921.  
  2922.         o   The packet's IP destination address must be the  IP  address
  2923.             of  the  receiving  interface,  or  one  of the IP multicast
  2924.             addresses AllSPFRouters or AllDRouters.
  2925.  
  2926.         o   The IP protocol specified must be OSPF (89).
  2927.  
  2928.         o   Locally originated packets should not be passed on to  OSPF.
  2929.             That  is,  the  source IP address should be examined to make
  2930.             sure this is not a multicast packet that the  router  itself
  2931.             generated.
  2932.  
  2933.  
  2934.         Next, the OSPF packet header is verified.  The fields  specified
  2935.         in  the  header  must  match  those configured for the receiving
  2936.         interface.  If they do not, the packet should be discarded:
  2937.  
  2938.  
  2939.         o   The version number field must specify protocol version 2.
  2940.  
  2941.         o   The 16-bit checksum of the OSPF packet's  contents  must  be
  2942.             verified.   Remember  that  the  64-bit authentication field
  2943.             must be excluded from the checksum calculation.
  2944.  
  2945.         o   The Area ID found in the OSPF header must be  verified.   If
  2946.             both  of the following cases fail, the packet should be dis-
  2947.             carded.  The Area ID specified in the header must either:
  2948.  
  2949.             (1) Match the Area ID of the receiving interface.   In  this
  2950.                 case,  the  packet  has  been  sent  over  a single hop.
  2951.                 Therefore, the packet's IP source address must be on the
  2952.                 same  network  as  the receiving interface.  This can be
  2953.                 determined by comparing the packet's IP  source  address
  2954.                 to  the  interface's  IP  address,  after  masking  both
  2955.                 addresses with the interface mask.
  2956.  
  2957.             (2) Indicate the backbone.  In this  case,  the  packet  has
  2958.                 been  sent  over  a  virtual link.  The receiving router
  2959.                 must be an area border router, and the router ID  speci-
  2960.                 fied in the packet (the source router) must be the other
  2961.                 end of a configured virtual link.  The receiving  inter-
  2962.                 face  must  also attach to the virtual link's configured
  2963.                 transit area.  If  all  of  these  checks  succeed,  the
  2964.                 packet  is  accepted  and is from now on associated with
  2965.  
  2966.  
  2967.  
  2968. [Moy]                                                          [Page 53]
  2969.  
  2970. Internet Draft               OSPF Version 2                November 1992
  2971.  
  2972.  
  2973.                 the virtual link (and the backbone area).
  2974.  
  2975.         o   Packets whose IP destination is AllDRouters should  only  be
  2976.             accepted  if  the  state of the receiving interface is DR or
  2977.             Backup (see Section 9.1).
  2978.  
  2979.         o   The Authentication type specified must match the authentica-
  2980.             tion type specified for the associated area.
  2981.  
  2982.  
  2983.         Next, the packet must be authenticated.   This  depends  on  the
  2984.         authentication type specified (see Appendix D).  The authentica-
  2985.         tion procedure may use an Authentication key, which can be  con-
  2986.         figured  on a per-interface basis.  If the authentication fails,
  2987.         the packet should be discarded.
  2988.  
  2989.         If the packet type is Hello, it should then be further processed
  2990.         by  the  Hello  Protocol  (see  Section 10.5).  All other packet
  2991.         types are sent/received only on adjacencies.   This  means  that
  2992.         the  packet  must  have  been sent by one of the router's active
  2993.         neighbors.  If the receiving interface is a multi-access network
  2994.         (either  broadcast or non-broadcast) the sender is identified by
  2995.         the IP source address found in the packet's IP header.   If  the
  2996.         receiving  interface is a point-to-point link or a virtual link,
  2997.         the sender is identified by the Router ID (source router)  found
  2998.         in the packet's OSPF header.  The data structure associated with
  2999.         the receiving interface contains the list of  active  neighbors.
  3000.         Packets not matching any active neighbor are discarded.
  3001.  
  3002.         At this point all received protocol packets are associated  with
  3003.         an  active  neighbor.   For  the  further  input  processing  of
  3004.         specific packet types, consult the sections listed in Table 11.
  3005.  
  3006.  
  3007.  
  3008.               Type   Packet name            detailed section (receive)
  3009.               ________________________________________________________
  3010.               1      Hello                  Section 10.5
  3011.               2      Database description   Section 10.6
  3012.               3      Link state request     Section 10.7
  3013.               4      Link state update      Section 13
  3014.               5      Link state ack         Section 13.7
  3015.  
  3016.  
  3017.                   Table 11: Sections describing packet reception.
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024. [Moy]                                                          [Page 54]
  3025.  
  3026. Internet Draft               OSPF Version 2                November 1992
  3027.  
  3028.  
  3029. 9.  The Interface Data Structure
  3030.  
  3031.     An OSPF interface is the connection between a router and a  network.
  3032.     There  is  a  single OSPF interface structure for each attached net-
  3033.     work; each interface structure has at most one IP interface  address
  3034.     (see below).  The support for multiple addresses on a single network
  3035.     is a matter for future consideration.
  3036.  
  3037.     An OSPF interface can be considered to belong to the area that  con-
  3038.     tains the attached network.  All routing protocol packets originated
  3039.     by the router over this interface are labelled with the  interface's
  3040.     Area  ID.  One or more router adjacencies may develop over an inter-
  3041.     face.  A router's link state advertisements reflect the state of its
  3042.     interfaces and their associated adjacencies.
  3043.  
  3044.     The following data items are associated  with  an  interface.   Note
  3045.     that  a  number  of  these  items are actually configuration for the
  3046.     attached network; those items must be the same for all routers  con-
  3047.     nected to the network.
  3048.  
  3049.  
  3050.     Type
  3051.         The kind of network to which the interface attaches.  Its  value
  3052.         is  either  broadcast,  non-broadcast  yet  still  multi-access,
  3053.         point-to-point or virtual link.
  3054.  
  3055.     State
  3056.         The functional level of an interface.  State determines  whether
  3057.         or  not full adjacencies are allowed to form over the interface.
  3058.         State is also reflected in the router's  link  state  advertise-
  3059.         ments.
  3060.  
  3061.     IP interface address
  3062.         The IP address associated with the interface.  This  appears  as
  3063.         the IP source address in all routing protocol packets originated
  3064.         over this interface.  Interfaces  to  unnumbered  point-to-point
  3065.         networks do not have an associated IP address.
  3066.  
  3067.     IP interface mask
  3068.         This indicates the portion of  the  IP  interface  address  that
  3069.         identifies  the  attached network.  This is often referred to as
  3070.         the subnet mask.  Masking the IP  interface  address  with  this
  3071.         value yields the IP network number of the attached network.
  3072.  
  3073.     Area ID
  3074.         The Area ID to which the attached network belongs.  All  routing
  3075.         protocol  packets  originating  from  the interface are labelled
  3076.         with this Area ID.
  3077.  
  3078.  
  3079.  
  3080. [Moy]                                                          [Page 55]
  3081.  
  3082. Internet Draft               OSPF Version 2                November 1992
  3083.  
  3084.  
  3085.     HelloInterval
  3086.         The length of time, in seconds, between the Hello  packets  that
  3087.         the  router sends on the interface.  Advertised in Hello packets
  3088.         sent out this interface.
  3089.  
  3090.     RouterDeadInterval
  3091.         The number of seconds before the router's neighbors will declare
  3092.         it down, when they stop hearing the router's hellos.  Advertised
  3093.         in Hello packets sent out this interface.
  3094.  
  3095.     InfTransDelay
  3096.         The estimated number of seconds it  takes  to  transmit  a  Link
  3097.         State  Update Packet over this interface.  Link state advertise-
  3098.         ments contained in the update packet will have their age  incre-
  3099.         mented  by  this  amount before transmission.  This value should
  3100.         take into account transmission and propagation delays;  it  must
  3101.         be greater than zero.
  3102.  
  3103.     Router Priority
  3104.         An 8-bit unsigned integer.  When two routers attached to a  net-
  3105.         work  both attempt to become Designated Router, the one with the
  3106.         highest Router Priority takes precedence.  A router whose Router
  3107.         Priority  is  set to 0 is ineligible to become Designated Router
  3108.         on the attached network.  Advertised in Hello packets  sent  out
  3109.         this interface.
  3110.  
  3111.     Hello Timer
  3112.         An interval timer that causes the  interface  to  send  a  Hello
  3113.         packet.   This  timer  fires  every HelloInterval seconds.  Note
  3114.         that on non-broadcast networks a separate Hello packet  is  sent
  3115.         to each qualified neighbor.
  3116.  
  3117.     Wait Timer
  3118.         A single shot timer that causes the interface to exit the  Wait-
  3119.         ing  state,  and  as a consequence select a Designated Router on
  3120.         the network.  The length  of  the  timer  is  RouterDeadInterval
  3121.         seconds.
  3122.  
  3123.     List of neighboring routers
  3124.         The other routers attached to  this  network.   On  multi-access
  3125.         networks,  this  list is formed by the Hello Protocol.  Adjacen-
  3126.         cies will be formed to some of  these  neighbors.   The  set  of
  3127.         adjacent neighbors can be determined by an examination of all of
  3128.         the neighbors' states.
  3129.  
  3130.     Designated Router
  3131.         The Designated Router selected for the  attached  network.   The
  3132.         Designated  Router  is  selected on all multi-access networks by
  3133.  
  3134.  
  3135.  
  3136. [Moy]                                                          [Page 56]
  3137.  
  3138. Internet Draft               OSPF Version 2                November 1992
  3139.  
  3140.  
  3141.         the Hello Protocol.  Two pieces of identification are  kept  for
  3142.         the  Designated  Router:  its  Router  ID  and  its interface IP
  3143.         address on the network.  The Designated Router  advertises  link
  3144.         state  for the network.  The network link state advertisement is
  3145.         labelled with the Designated Router's IP address.  This item  is
  3146.         initialized  to  0,  which  indicates  the  lack of a Designated
  3147.         Router.
  3148.  
  3149.     Backup Designated Router
  3150.         The Backup Designated Router is  also  selected  on  all  multi-
  3151.         access  networks  by  the  Hello  Protocol.   All routers on the
  3152.         attached network become adjacent to both the  Designated  Router
  3153.         and  the Backup Designated Router.  The Backup Designated Router
  3154.         becomes Designated Router when  the  current  Designated  Router
  3155.         fails.   Initialized to 0 indicating the lack of a Backup Desig-
  3156.         nated Router.
  3157.  
  3158.     Interface output cost(s)
  3159.         The cost of sending a packet on the interface, expressed in  the
  3160.         link state metric.  This is advertised as the link cost for this
  3161.         interface in the router links advertisement.   There  may  be  a
  3162.         separate  cost  for  each  IP  Type  of Service.  The cost of an
  3163.         interface must be greater than zero.
  3164.  
  3165.     RxmtInterval
  3166.         The  number  of  seconds  between   link   state   advertisement
  3167.         retransmissions,  for  adjacencies  belonging to this interface.
  3168.         Also used when  retransmitting  Database  Description  and  Link
  3169.         State Request Packets.
  3170.  
  3171.     Authentication key
  3172.         This configured data allows the authentication procedure to gen-
  3173.         erate and/or verify the authentication field in the OSPF header.
  3174.         The authentication key can  be  configured  on  a  per-interface
  3175.         basis.  For example, if the authentication type indicates simple
  3176.         password, the authentication key would  be  a  64-bit  password.
  3177.         This  key  would  be inserted directly into the OSPF header when
  3178.         originating routing protocol  packets,  and  there  could  be  a
  3179.         separate password for each network.
  3180.  
  3181.  
  3182.     9.1.  Interface states
  3183.  
  3184.         The various states that router interface  may  attain  is  docu-
  3185.         mented  in this section.  The states are listed in order of pro-
  3186.         gressing functionality.  For example, the inoperative  state  is
  3187.         listed  first,  followed by a list of intermediate states before
  3188.         the  final,   fully   functional   state   is   achieved.    The
  3189.  
  3190.  
  3191.  
  3192. [Moy]                                                          [Page 57]
  3193.  
  3194. Internet Draft               OSPF Version 2                November 1992
  3195.  
  3196.  
  3197.         specification  makes  use  of  this ordering by sometimes making
  3198.         references such as "those interfaces in state greater  than  X".
  3199.         Figure  11 shows the graph of interface state changes.  The arcs
  3200.         of the graph are labelled  with  the  event  causing  the  state
  3201.         change.  These events are documented in Section 9.2.  The inter-
  3202.         face state machine is described in more detail in Section 9.3.
  3203.  
  3204.  
  3205.         Down
  3206.             This is the initial interface state.   In  this  state,  the
  3207.             lower-level  protocols  have indicated that the interface is
  3208.             unusable.  No protocol  traffic  at  all  will  be  sent  or
  3209.             received  on  such  a  interface.   In this state, interface
  3210.             parameters should be  set  to  their  initial  values.   All
  3211.             interface  timers should be disabled, and there should be no
  3212.             adjacencies associated with the interface.
  3213.  
  3214.                                   +----+   UnloopInd   +--------+
  3215.                                   |Down|<--------------|Loopback|
  3216.                                   +----+               +--------+
  3217.                                      |
  3218.                                      |InterfaceUp
  3219.                           +-------+  |               +--------------+
  3220.                           |Waiting|<-+-------------->|Point-to-point|
  3221.                           +-------+                  +--------------+
  3222.                               |
  3223.                      WaitTimer|BackupSeen
  3224.                               |
  3225.                               |
  3226.                               |       NbrChg
  3227.           +------+           +-+<---------------- +-------+
  3228.           |Backup|<----------|?|----------------->|DROther|
  3229.           +------+---------->+-+<-----+           +-------+
  3230.                     NbrChg    |       |
  3231.                               |       |NbrChg
  3232.                               |       |
  3233.                               |     +--+
  3234.                               +---->|DR|
  3235.                                     +--+
  3236.  
  3237.                       Figure 11: Interface State changes
  3238.  
  3239.                  In addition to the state transitions pictured,
  3240.                  Event InterfaceDown always forces Down State, and
  3241.                  Event LoopInd always forces Loopback State
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248. [Moy]                                                          [Page 58]
  3249.  
  3250. Internet Draft               OSPF Version 2                November 1992
  3251.  
  3252.  
  3253.         Loopback
  3254.             In this state, the router's  interface  to  the  network  is
  3255.             looped  back.   The interface may be looped back in hardware
  3256.             or software.  The interface will be unavailable for  regular
  3257.             data  traffic.   However,  it may still be desirable to gain
  3258.             information on the quality of this interface, either through
  3259.             sending  ICMP  pings  to  the interface or through something
  3260.             like a bit error test.  For  this  reason,  IP  packets  may
  3261.             still  be  addressed  to an interface in Loopback state.  To
  3262.             facilitate this, such interfaces are  advertised  in  router
  3263.             links  advertisements  as single host routes, whose destina-
  3264.             tion is the IP interface address.[4]
  3265.  
  3266.         Waiting
  3267.             In this state, the router is trying to determine  the  iden-
  3268.             tity of the Backup Designated Router for the network.  To do
  3269.             this, the router  monitors  the  Hellos  it  receives.   The
  3270.             router  is  not  allowed to elect a Backup Designated Router
  3271.             nor Designated Router until it transitions  out  of  Waiting
  3272.             state.  This prevents unnecessary changes of (Backup) Desig-
  3273.             nated Router.
  3274.  
  3275.         Point-to-point
  3276.             In this state, the interface is  operational,  and  connects
  3277.             either  to a physical point-to-point network or to a virtual
  3278.             link.  Upon entering this state, the router attempts to form
  3279.             an  adjacency  with the neighboring router.  Hellos are sent
  3280.             to the neighbor every HelloInterval seconds.
  3281.  
  3282.         DR Other
  3283.             The interface is to a multi-access network on which  another
  3284.             router  has  been  selected to be the Designated Router.  In
  3285.             this state, the router itself has not been  selected  Backup
  3286.             Designated  Router  either.  The router forms adjacencies to
  3287.             both the Designated Router and the Backup Designated  Router
  3288.             (if they exist).
  3289.  
  3290.         Backup
  3291.             In this state, the router itself is  the  Backup  Designated
  3292.             Router  on  the  attached  network.   It will be promoted to
  3293.             Designated Router when the present Designated Router  fails.
  3294.             The  router  establishes  adjacencies  to  all other routers
  3295.             attached to the network.  The Backup Designated Router  per-
  3296.             forms  slightly different functions during the Flooding Pro-
  3297.             cedure, as compared to the Designated  Router  (see  Section
  3298.             13.3).   See  Section  7.4 for more details on the functions
  3299.             performed by the Backup Designated Router.
  3300.  
  3301.  
  3302.  
  3303.  
  3304. [Moy]                                                          [Page 59]
  3305.  
  3306. Internet Draft               OSPF Version 2                November 1992
  3307.  
  3308.  
  3309.         DR  In this state, this router itself is the  Designated  Router
  3310.             on the attached network.  Adjacencies are established to all
  3311.             other routers attached to the network.  The router must also
  3312.             originate  a  network  links  advertisement  for the network
  3313.             node.  The advertisement will contain links to  all  routers
  3314.             (including  the  Designated  Router  itself) attached to the
  3315.             network.  See Section 7.3 for more details on the  functions
  3316.             performed by the Designated Router.
  3317.  
  3318.  
  3319.     9.2.  Events causing interface state changes
  3320.  
  3321.         State changes can be effected by  a  number  of  events.   These
  3322.         events  are  pictured  as  the  labelled arcs in Figure 11.  The
  3323.         label definitions are listed below.  For a detailed  explanation
  3324.         of  the  effect of these events on OSPF protocol operation, con-
  3325.         sult Section 9.3.
  3326.  
  3327.  
  3328.         Interface Up
  3329.             Lower-level protocols have indicated that the network inter-
  3330.             face  is operational.  This enables the interface to transi-
  3331.             tion out of Down state.  On  virtual  links,  the  interface
  3332.             operational  indication is actually a result of the shortest
  3333.             path calculation (see Section 16.7).
  3334.  
  3335.         Wait Timer
  3336.             The Wait timer has fired, indicating the end of the  waiting
  3337.             period  that  is  required before electing a (Backup) Desig-
  3338.             nated Router.
  3339.  
  3340.         Backup seen
  3341.             The router has detected the existence or non-existence of  a
  3342.             Backup  Designated  Router for the network.  This is done in
  3343.             one of two ways.  First, a Hello Packet may be received from
  3344.             a  neighbor  claiming  to  be  itself  the Backup Designated
  3345.             Router.  Alternatively, a Hello Packet may be received  from
  3346.             a  neighbor claiming to be itself the Designated Router, and
  3347.             indicating that there is no Backup.  In  either  case  there
  3348.             must be bidirectional communication with the neighbor, i.e.,
  3349.             the router must also appear in the neighbor's Hello  Packet.
  3350.             This event signals an end to the Waiting state.
  3351.  
  3352.         Neighbor Change
  3353.             There has been a change in the set of  bidirectional  neigh-
  3354.             bors associated with the interface.  The (Backup) Designated
  3355.             Router needs to be  recalculated.   The  following  neighbor
  3356.             changes   lead   to  the  Neighbor  Change  event.   For  an
  3357.  
  3358.  
  3359.  
  3360. [Moy]                                                          [Page 60]
  3361.  
  3362. Internet Draft               OSPF Version 2                November 1992
  3363.  
  3364.  
  3365.             explanation of neighbor states, see Section 10.1.
  3366.  
  3367.             o   Bidirectional communication has been  established  to  a
  3368.                 neighbor.  In other words, the state of the neighbor has
  3369.                 transitioned to 2-Way or higher.
  3370.  
  3371.             o   There is no longer bidirectional  communication  with  a
  3372.                 neighbor.  In other words, the state of the neighbor has
  3373.                 transitioned to Init or lower.
  3374.  
  3375.             o   One of the bidirectional neighbors  is  newly  declaring
  3376.                 itself  as either Designated Router or Backup Designated
  3377.                 Router.  This is detected through  examination  of  that
  3378.                 neighbor's Hello Packets.
  3379.  
  3380.             o   One of the bidirectional neighbors is no longer  declar-
  3381.                 ing itself as Designated Router, or is no longer declar-
  3382.                 ing itself as Backup Designated Router.  This  is  again
  3383.                 detected  through  examination  of that neighbor's Hello
  3384.                 Packets.
  3385.  
  3386.             o   The  advertised  Router  Priority  for  a  bidirectional
  3387.                 neighbor  has  changed.   This is again detected through
  3388.                 examination of that neighbor's Hello Packets.
  3389.  
  3390.         Loop Ind
  3391.             An indication has been received that the  interface  is  now
  3392.             looped  back  to  itself.   This  indication can be received
  3393.             either from network management or from the lower level  pro-
  3394.             tocols.
  3395.  
  3396.         Unloop Ind
  3397.             An indication has been received that  the  interface  is  no
  3398.             longer  looped back.  As with the Loop Ind event, this indi-
  3399.             cation can be received either  from  network  management  or
  3400.             from the lower level protocols.
  3401.  
  3402.         Interface Down
  3403.             Lower-level protocols indicate that  this  interface  is  no
  3404.             longer  functional.   No  matter  what the current interface
  3405.             state is, the new interface state will be Down.
  3406.  
  3407.  
  3408.     9.3.  The Interface state machine
  3409.  
  3410.         A detailed description of the interface state  changes  follows.
  3411.         Each  state  change  is invoked by an event (Section 9.2).  This
  3412.         event may produce different effects, depending  on  the  current
  3413.  
  3414.  
  3415.  
  3416. [Moy]                                                          [Page 61]
  3417.  
  3418. Internet Draft               OSPF Version 2                November 1992
  3419.  
  3420.  
  3421.         state  of  the  interface.   For  this reason, the state machine
  3422.         below is organized  by  current  interface  state  and  received
  3423.         event.   Each entry in the state machine describes the resulting
  3424.         new interface state and the required set of additional actions.
  3425.  
  3426.         When an interface's state changes, it may be necessary  to  ori-
  3427.         ginate  a  new router links advertisement.  See Section 12.4 for
  3428.         more details.
  3429.  
  3430.         Some of the required actions below involve generating events for
  3431.         the  neighbor  state  machine.   For  example, when an interface
  3432.         becomes inoperative, all neighbor  connections  associated  with
  3433.         the  interface  must  be destroyed.  For more information on the
  3434.         neighbor state machine, see Section 10.3.
  3435.  
  3436.  
  3437.          State(s):  Down
  3438.  
  3439.             Event:  Interface Up
  3440.  
  3441.         New state:  Depends on action routine
  3442.  
  3443.             Action:  Start  the  interval  Hello  Timer,  enabling   the
  3444.                     periodic sending of Hello packets out the interface.
  3445.                     If the attached network is a physical point-to-point
  3446.                     network or virtual link, the interface state transi-
  3447.                     tions to Point-to-Point.  Else, if the router is not
  3448.                     eligible  to  become Designated Router the interface
  3449.                     state transitions to DR other.
  3450.  
  3451.                     Otherwise, the attached network is multi-access  and
  3452.                     the  router is eligible to become Designated Router.
  3453.                     In this case, in an attempt to discover the attached
  3454.                     network's  Designated  Router the interface state is
  3455.                     set to Waiting and the single  shot  Wait  Timer  is
  3456.                     started.   If  in  addition  the attached network is
  3457.                     non-broadcast, examine the configured list of neigh-
  3458.                     bors  for  this  interface and generate the neighbor
  3459.                     event Start for each neighbor that is also  eligible
  3460.                     to become Designated Router.
  3461.  
  3462.  
  3463.          State(s):  Waiting
  3464.  
  3465.             Event:  Backup Seen
  3466.  
  3467.         New state:  Depends upon action routine.
  3468.  
  3469.  
  3470.  
  3471.  
  3472. [Moy]                                                          [Page 62]
  3473.  
  3474. Internet Draft               OSPF Version 2                November 1992
  3475.  
  3476.  
  3477.            Action:  Calculate the attached network's  Backup  Designated
  3478.                     Router  and  Designated  Router, as shown in Section
  3479.                     9.4.  As a result of this calculation, the new state
  3480.                     of  the interface will be either DR other, Backup or
  3481.                     DR.
  3482.  
  3483.  
  3484.          State(s):  Waiting
  3485.  
  3486.             Event:  Wait Timer
  3487.  
  3488.         New state:  Depends upon action routine.
  3489.  
  3490.            Action:  Calculate the attached network's  Backup  Designated
  3491.                     Router  and  Designated  Router, as shown in Section
  3492.                     9.4.  As a result of this calculation, the new state
  3493.                     of  the interface will be either DR other, Backup or
  3494.                     DR.
  3495.  
  3496.  
  3497.          State(s):  DR Other, Backup or DR
  3498.  
  3499.             Event:  Neighbor Change
  3500.  
  3501.         New state:  Depends upon action routine.
  3502.  
  3503.            Action:  Recalculate the attached network's Backup Designated
  3504.                     Router  and  Designated  Router, as shown in Section
  3505.                     9.4.  As a result of this calculation, the new state
  3506.                     of  the interface will be either DR other, Backup or
  3507.                     DR.
  3508.  
  3509.  
  3510.          State(s):  Any State
  3511.  
  3512.             Event:  Interface Down
  3513.  
  3514.         New state:  Down
  3515.  
  3516.            Action:  All interface variables  are  reset,  and  interface
  3517.                     timers  disabled.   Also,  all  neighbor connections
  3518.                     associated with the interface are  destroyed.   This
  3519.                     is done by generating the event KillNbr on all asso-
  3520.                     ciated neighbors (see Section 10.2).
  3521.  
  3522.  
  3523.          State(s):  Any State
  3524.  
  3525.  
  3526.  
  3527.  
  3528. [Moy]                                                          [Page 63]
  3529.  
  3530. Internet Draft               OSPF Version 2                November 1992
  3531.  
  3532.  
  3533.             Event:  Loop Ind
  3534.  
  3535.         New state:  Loopback
  3536.  
  3537.            Action:  Since this interface is no longer connected  to  the
  3538.                     attached  network  the  actions  associated with the
  3539.                     above Interface Down event are executed.
  3540.  
  3541.  
  3542.          State(s):  Loopback
  3543.  
  3544.             Event:  Unloop Ind
  3545.  
  3546.         New state:  Down
  3547.  
  3548.            Action:  No actions are necessary.  For example,  the  inter-
  3549.                     face variables have already been reset upon entering
  3550.                     the Loopback  state.   Note  that  reception  of  an
  3551.                     Interface Up event is necessary before the interface
  3552.                     again becomes fully functional.
  3553.  
  3554.  
  3555.     9.4.  Electing the Designated Router
  3556.  
  3557.         This section describes the  algorithm  used  for  calculating  a
  3558.         network's  Designated Router and Backup Designated Router.  This
  3559.         algorithm is invoked by the Interface state machine.   The  ini-
  3560.         tial  time  a  router runs the election algorithm for a network,
  3561.         the network's Designated Router and Backup Designated Router are
  3562.         initialized  to  0.0.0.0.   This  indicates  the  lack of both a
  3563.         Designated Router and a Backup Designated Router.
  3564.  
  3565.         The Designated Router election algorithm  proceeds  as  follows:
  3566.         Call  the  router  doing  the calculation Router X.  The list of
  3567.         neighbors  attached  to  the  network  and  having   established
  3568.         bidirectional  communication  with  Router  X is examined.  This
  3569.         list is precisely the collection of  Router  X's  neighbors  (on
  3570.         this network) whose state is greater than or equal to 2-Way (see
  3571.         Section 10.1).  Router X itself is also considered to be on  the
  3572.         list.   Discard all routers from the list that are ineligible to
  3573.         become Designated Router.  (Routers having Router Priority of  0
  3574.         are  ineligible  to  become  Designated  Router.)  The following
  3575.         steps are then executed, considering  only  those  routers  that
  3576.         remain on the list:
  3577.  
  3578.  
  3579.         (1) Note the current values for the network's Designated  Router
  3580.             and  Backup  Designated  Router.   This  is  used  later for
  3581.  
  3582.  
  3583.  
  3584. [Moy]                                                          [Page 64]
  3585.  
  3586. Internet Draft               OSPF Version 2                November 1992
  3587.  
  3588.  
  3589.             comparison purposes.
  3590.  
  3591.         (2) Calculate the new Backup Designated Router for  the  network
  3592.             as  follows.   Only  those routers on the list that have not
  3593.             declared themselves to be Designated Router are eligible  to
  3594.             become  Backup  Designated  Router.  If one or more of these
  3595.             routers have declared themselves  Backup  Designated  Router
  3596.             (i.e.,  they  are  currently  listing  themselves  as Backup
  3597.             Designated Router, but not as Designated  Router,  in  their
  3598.             Hello  Packets)  the  one  having highest Router Priority is
  3599.             declared to be Backup Designated Router.  In case of a  tie,
  3600.             the  one  having  the  highest  Router  ID is chosen.  If no
  3601.             routers have declared themselves Backup  Designated  Router,
  3602.             choose  the  router  having  highest Router Priority, (again
  3603.             excluding those routers who have declared themselves  Desig-
  3604.             nated Router), and again use the Router ID to break ties.
  3605.  
  3606.         (3) Calculate the new Designated Router for the network as  fol-
  3607.             lows.   If  one  or  more of the routers have declared them-
  3608.             selves Designated Router (i.e., they are  currently  listing
  3609.             themselves  as Designated Router in their Hello Packets) the
  3610.             one having highest Router Priority is declared to be  Desig-
  3611.             nated  Router.  In case of a tie, the one having the highest
  3612.             Router ID is chosen.  If no routers have declared themselves
  3613.             Designated  Router,  assign  the Designated Router to be the
  3614.             same as the newly elected Backup Designated Router.
  3615.  
  3616.         (4) If Router X is now newly the Designated Router or newly  the
  3617.             Backup Designated Router, or is now no longer the Designated
  3618.             Router or no longer the  Backup  Designated  Router,  repeat
  3619.             steps  2 and 3, and then proceed to step 5.  For example, if
  3620.             Router X is now  the  Designated  Router,  when  step  2  is
  3621.             repeated  X will no longer be eligible for Backup Designated
  3622.             Router election.  Among other things, this will ensure  that
  3623.             no  router will declare itself both Backup Designated Router
  3624.             and Designated Router.[5]
  3625.  
  3626.         (5) As a result of these calculations, the router itself may now
  3627.             be  Designated Router or Backup Designated Router.  See Sec-
  3628.             tions 7.3 and 7.4  for  the  additional  duties  this  would
  3629.             entail.   The router's interface state should be set accord-
  3630.             ingly.  If the router itself is now Designated  Router,  the
  3631.             new  interface  state  is  DR.   If the router itself is now
  3632.             Backup Designated Router, the new interface state is Backup.
  3633.             Otherwise, the new interface state is DR Other.
  3634.  
  3635.         (6) If the attached network is  non-broadcast,  and  the  router
  3636.             itself  has  just  become either Designated Router or Backup
  3637.  
  3638.  
  3639.  
  3640. [Moy]                                                          [Page 65]
  3641.  
  3642. Internet Draft               OSPF Version 2                November 1992
  3643.  
  3644.  
  3645.             Designated Router, it must start  sending  hellos  to  those
  3646.             neighbors  that are not eligible to become Designated Router
  3647.             (see Section 9.5.1).  This is done by invoking the  neighbor
  3648.             event Start for each neighbor having a Router Priority of 0.
  3649.  
  3650.         (7) If the above calculations have caused the identity of either
  3651.             the Designated Router or Backup Designated Router to change,
  3652.             the set of adjacencies associated with this  interface  will
  3653.             need  to  be  modified.   Some  adjacencies  may  need to be
  3654.             formed, and others may need to  be  broken.   To  accomplish
  3655.             this,  invoke the event AdjOK?  on all neighbors whose state
  3656.             is at least 2-Way.  This will cause  their  eligibility  for
  3657.             adjacency to be reexamined (see Sections 10.3 and 10.4).
  3658.  
  3659.  
  3660.         The reason behind the election  algorithm's  complexity  is  the
  3661.         desire  for  an orderly transition from Backup Designated Router
  3662.         to Designated Router, when the current Designated Router  fails.
  3663.         This  orderly  transition is ensured through the introduction of
  3664.         hysteresis: no new Backup router can be  chosen  until  the  old
  3665.         Backup accepts its new Designated Router responsibilities.
  3666.  
  3667.         The above procedure may elect the same router to be both  Desig-
  3668.         nated  Router and Backup Designated Router, although that router
  3669.         will never be the calculating  router  (Router  X)  itself.  The
  3670.         elected  Designated  Router  may  not  be  the router having the
  3671.         highest Router Priority, nor will the Backup  Designated  Router
  3672.         necessarily  have the second highest Router Priority.  If Router
  3673.         X is not itself eligible to become Designated Router, it is pos-
  3674.         sible  that  neither a Backup Designated Router nor a Designated
  3675.         Router will be selected in the above procedure.  Note also  that
  3676.         if  Router  X  is  the  only attached router that is eligible to
  3677.         become Designated Router, it will select  itself  as  Designated
  3678.         Router  and  there  will  be no Backup Designated Router for the
  3679.         network.
  3680.  
  3681.  
  3682.     9.5.  Sending Hello packets
  3683.  
  3684.         Hello packets are sent out each  functioning  router  interface.
  3685.         They  are  used  to  discover  and  maintain  neighbor relation-
  3686.         ships.[6] On multi-access networks,  hellos  are  also  used  to
  3687.         elect the Designated Router and Backup Designated Router, and in
  3688.         that way determine what adjacencies should be formed.
  3689.  
  3690.         The format of a Hello packet is detailed in Section A.3.2.   The
  3691.         Hello  Packet  contains  the  router's  Router Priority (used in
  3692.         choosing the Designated Router), and the interval between  Hello
  3693.  
  3694.  
  3695.  
  3696. [Moy]                                                          [Page 66]
  3697.  
  3698. Internet Draft               OSPF Version 2                November 1992
  3699.  
  3700.  
  3701.         broadcasts (HelloInterval).  The Hello Packet also indicates how
  3702.         often a neighbor must be heard from to  remain  active  (Router-
  3703.         DeadInterval).   Both  HelloInterval and RouterDeadInterval must
  3704.         be the same for all routers attached to a common  network.   The
  3705.         Hello  packet  also contains the IP address mask of the attached
  3706.         network (Network Mask).  On unnumbered  point-to-point  networks
  3707.         and on virtual links this field should be set to 0.
  3708.  
  3709.         The Hello packet's Options field describes the router's optional
  3710.         OSPF  capabilities.   There are currently two optional capabili-
  3711.         ties defined (see Sections 4.5  and  A.2).   The  T-bit  of  the
  3712.         Options  field  should be set if the router is capable of calcu-
  3713.         lating separate routes for each IP TOS.  The E-bit should be set
  3714.         if  and  only  if  the attached area is capable of processing AS
  3715.         external advertisements (i.e., it is not a stub area).   If  the
  3716.         E-bit  is set incorrectly the neighboring routers will refuse to
  3717.         accept the Hello Packet (see Section 10.5).   The  rest  of  the
  3718.         Hello Packet's Options field should be set to zero.
  3719.  
  3720.         In  order  to  ensure  two-way  communication  between  adjacent
  3721.         routers,  the Hello packet contains the list of all routers from
  3722.         which hellos have been seen recently.   The  Hello  packet  also
  3723.         contains  the  router's current choice for Designated Router and
  3724.         Backup Designated Router.  A value of 0 in  these  fields  means
  3725.         that one has not yet been selected.
  3726.  
  3727.         On broadcast  networks  and  physical  point-to-point  networks,
  3728.         Hello  packets  are  sent  every HelloInterval seconds to the IP
  3729.         multicast address AllSPFRouters.  On virtual links, Hello  pack-
  3730.         ets are sent as unicasts (addressed directly to the other end of
  3731.         the virtual link) every HelloInterval seconds.  On non-broadcast
  3732.         networks,  the  sending  of  Hello  packets is more complicated.
  3733.         This will be covered in the next section.
  3734.  
  3735.  
  3736.         9.5.1.  Sending Hello packets on non-broadcast networks
  3737.  
  3738.             Static configuration information is necessary in  order  for
  3739.             the  Hello  Protocol  to  function on non-broadcast networks
  3740.             (see Section C.5).  Every attached router which is  eligible
  3741.             to  become Designated Router has a configured list of all of
  3742.             its neighbors on  the  network.   Each  listed  neighbor  is
  3743.             labelled with its Designated Router eligibility.
  3744.  
  3745.             The interface state must be at least Waiting for any  hellos
  3746.             to  be sent.  Hellos are then sent directly (as unicasts) to
  3747.             some subset of a router's neighbors.  Sometimes an hello  is
  3748.             sent periodically on a timer; at other times it is sent as a
  3749.  
  3750.  
  3751.  
  3752. [Moy]                                                          [Page 67]
  3753.  
  3754. Internet Draft               OSPF Version 2                November 1992
  3755.  
  3756.  
  3757.             response to a  received  hello.   A  router's  hello-sending
  3758.             behavior  varies  depending  on whether the router itself is
  3759.             eligible to become Designated Router.
  3760.  
  3761.             If the router is eligible to become  Designated  Router,  it
  3762.             must periodically send hellos to all neighbors that are also
  3763.             eligible.  In addition, if the router is itself  the  Desig-
  3764.             nated  Router or Backup Designated Router, it must also send
  3765.             periodic hellos to all other neighbors.  This means that any
  3766.             two  eligible routers are always exchanging hellos, which is
  3767.             necessary for the correct operation of the Designated Router
  3768.             election  algorithm.  To minimize the number of hellos sent,
  3769.             the number of eligible routers on  a  non-broadcast  network
  3770.             should be kept small.
  3771.  
  3772.             If the router is not eligible to become  Designated  Router,
  3773.             it  must  periodically  send  hellos  to both the Designated
  3774.             Router and the Backup Designated Router (if they exist).  It
  3775.             must  also  send an hello in reply to an hello received from
  3776.             any eligible neighbor (other  than  the  current  Designated
  3777.             Router  and  Backup  Designated  Router).  This is needed to
  3778.             establish an initial  bidirectional  relationship  with  any
  3779.             potential Designated Router.
  3780.  
  3781.             When sending Hello packets periodically to any neighbor, the
  3782.             interval  between  hellos  is  determined  by the neighbor's
  3783.             state.  If the neighbor is in state Down,  hellos  are  sent
  3784.             every  PollInterval  seconds.   Otherwise,  hellos  are sent
  3785.             every HelloInterval seconds.
  3786.  
  3787.  
  3788. 10.  The Neighbor Data Structure
  3789.  
  3790.     An  OSPF  router  converses  with  its  neighboring  routers.   Each
  3791.     separate  conversation  is described by a "neighbor data structure".
  3792.     Each conversation is bound to a particular  OSPF  router  interface,
  3793.     and  is identified either by the neighboring router's OSPF router ID
  3794.     or by its Neighbor IP address (see below).  Thus if the OSPF  router
  3795.     and another router have multiple attached networks in common, multi-
  3796.     ple conversations ensue, each described by a  unique  neighbor  data
  3797.     structure.  Each separate conversation is loosely referred to in the
  3798.     text as being a separate "neighbor".
  3799.  
  3800.     The neighbor data structure contains all  information  pertinent  to
  3801.     the  forming  or  formed adjacency between the two neighbors.  (How-
  3802.     ever, remember that not all neighbors become  adjacent.)   An  adja-
  3803.     cency  can  be viewed as a highly developed conversation between two
  3804.     routers.
  3805.  
  3806.  
  3807.  
  3808. [Moy]                                                          [Page 68]
  3809.  
  3810. Internet Draft               OSPF Version 2                November 1992
  3811.  
  3812.  
  3813.     State
  3814.         The functional level of  the  neighbor  conversation.   This  is
  3815.         described in more detail in Section 10.1.
  3816.  
  3817.     Inactivity Timer
  3818.         A single shot timer whose firing indicates that no Hello  Packet
  3819.         has  been  seen  from this neighbor recently.  The length of the
  3820.         timer is RouterDeadInterval seconds.
  3821.  
  3822.     Master/Slave
  3823.         When the two neighbors are exchanging  databases,  they  form  a
  3824.         Master  Slave relationship.  The Master sends the first Database
  3825.         Description Packet, and is the only  part  that  is  allowed  to
  3826.         retransmit.  The slave can only respond to the master's Database
  3827.         Description Packets.  The  master/slave  relationship  is  nego-
  3828.         tiated in state ExStart.
  3829.  
  3830.     Sequence Number
  3831.         A 32-bit  number  identifying  individual  Database  Description
  3832.         packets.   When  the  neighbor  state  ExStart  is  entered, the
  3833.         sequence number should be set to a value not previously seen  by
  3834.         the  neighboring  router.   One  possible  scheme  is to use the
  3835.         machine's time of day counter.   The  sequence  number  is  then
  3836.         incremented  by  the  master  with each new Database Description
  3837.         packet sent.  The slave's sequence  number  indicates  the  last
  3838.         packet  received  from  the  master.  Only one packet is allowed
  3839.         outstanding at a time.
  3840.  
  3841.     Neighbor ID
  3842.         The OSPF Router ID of the neighboring router.  The  neighbor  ID
  3843.         is learned when Hello packets are received from the neighbor, or
  3844.         is configured if this is a virtual adjacency (see Section C.4).
  3845.  
  3846.     Neighbor priority
  3847.         The Router Priority of the neighboring router.  Contained in the
  3848.         neighbor's  Hello  packets, this item is used when selecting the
  3849.         Designated Router for the attached network.
  3850.  
  3851.     Neighbor IP address
  3852.         The IP address of the  neighboring  router's  interface  to  the
  3853.         attached  network.  Used as the Destination IP address when pro-
  3854.         tocol packets are sent as unicasts along this  adjacency.   Also
  3855.         used  in  router  links  advertisements  as  the Link ID for the
  3856.         attached network if the neighboring router  is  selected  to  be
  3857.         Designated Router (see Section 12.4.1).  The neighbor IP address
  3858.         is learned when Hello packets are received  from  the  neighbor.
  3859.         For virtual links, the neighbor IP address is learned during the
  3860.         routing table build process (see Section 15).
  3861.  
  3862.  
  3863.  
  3864. [Moy]                                                          [Page 69]
  3865.  
  3866. Internet Draft               OSPF Version 2                November 1992
  3867.  
  3868.  
  3869.     Neighbor Options
  3870.         The  optional  OSPF  capabilities  supported  by  the  neighbor.
  3871.         Learned during the Database Exchange process (see Section 10.6).
  3872.         The neighbor's optional OSPF capabilities are also listed in its
  3873.         Hello  packets.   This  enables  received  Hellos to be rejected
  3874.         (i.e., neighbor relationships will not even start  to  form)  if
  3875.         there  is  a  mismatch in certain crucial OSPF capabilities (see
  3876.         Section 10.5).  The optional OSPF capabilities are documented in
  3877.         Section 4.5.
  3878.  
  3879.     Neighbor's Designated Router
  3880.         The neighbor's idea of the Designated Router.  If  this  is  the
  3881.         neighbor  itself,  this is important in the local calculation of
  3882.         the Designated Router.  Defined only on multi-access networks.
  3883.  
  3884.     Neighbor's Backup Designated Router
  3885.         The neighbor's idea of the Backup Designated Router.  If this is
  3886.         the  neighbor itself, this is important in the local calculation
  3887.         of the Backup Designated Router.  Defined only  on  multi-access
  3888.         networks.
  3889.  
  3890.  
  3891.     The next set of variables are lists of  link  state  advertisements.
  3892.     These  lists  describe  subsets  of  the  area topological database.
  3893.     There can be five distinct types of link state advertisements in  an
  3894.     area  topological  database: router links, network links, and type 3
  3895.     and 4 summary links (all stored in the area data structure), and  AS
  3896.     external links (stored in the global data structure).
  3897.  
  3898.  
  3899.     Link state retransmission list
  3900.         The list of link state advertisements that have been flooded but
  3901.         not acknowledged on this adjacency.  These will be retransmitted
  3902.         at intervals until they are acknowledged, or until the adjacency
  3903.         is destroyed.
  3904.  
  3905.     Database summary list
  3906.         The complete list of link state advertisements that make up  the
  3907.         area  topological database, at the moment the neighbor goes into
  3908.         Database Exchange state.  This list is sent to the  neighbor  in
  3909.         Database Description packets.
  3910.  
  3911.     Link state request list
  3912.         The list of link state advertisements that need to  be  received
  3913.         from  this  neighbor  in order to synchronize the two neighbors'
  3914.         topological  databases.   This  list  is  created  as   Database
  3915.         Description packets are received, and is then sent to the neigh-
  3916.         bor in Link State Request packets.   The  list  is  depleted  as
  3917.  
  3918.  
  3919.  
  3920. [Moy]                                                          [Page 70]
  3921.  
  3922. Internet Draft               OSPF Version 2                November 1992
  3923.  
  3924.  
  3925.         appropriate Link State Update packets are received.
  3926.  
  3927.  
  3928.     10.1.  Neighbor states
  3929.  
  3930.         The state of a neighbor (really, the  state  of  a  conversation
  3931.         being  held with a neighboring router) is documented in the fol-
  3932.         lowing sections.  The states are listed in order of  progressing
  3933.         functionality.   For  example,  the  inoperative state is listed
  3934.         first, followed by a list  of  intermediate  states  before  the
  3935.         final,  fully  functional  state is achieved.  The specification
  3936.         makes use of this ordering by sometimes making  references  such
  3937.         as  "those neighbors/adjacencies in state greater than X".  Fig-
  3938.         ures 12 and 13 show the graph of neighbor  state  changes.   The
  3939.         arcs of the graphs are labelled with the event causing the state
  3940.         change.  The neighbor events are  documented  in  Section  10.2.
  3941.         The  graph  in  Figure 12 show the state changes effected by the
  3942.         Hello Protocol.  The Hello Protocol is responsible for  neighbor
  3943.         acquisition   and   maintenance,   and   for  ensuring  two  way
  3944.  
  3945.                                    +----+
  3946.                                    |Down|
  3947.                                    +----+
  3948.                                      |
  3949.                                      | Start
  3950.                                      |        +-------+
  3951.                              Hello   |   +---->|Attempt|
  3952.                             Received |         +-------+
  3953.                                      |             |
  3954.                              +----+<-+             |HelloReceived
  3955.                              |Init|<---------------+
  3956.                              +----+<--------+
  3957.                                 |           |
  3958.                                 |2-Way      |
  3959.                                 |received   |1-Way
  3960.                                 |           |
  3961.               +-------+         |        +-----+
  3962.               |ExStart|<--------+------->|2-Way|
  3963.               +-------+                  +-----+
  3964.  
  3965.               Figure 12: Neighbor state changes (Hello Protocol)
  3966.  
  3967.                   In addition to the state transitions pictured,
  3968.                   Event KillNbr always forces Down State,
  3969.                   Event InactivityTimer always forces Down State,
  3970.                   Event LLDown always forces Down State
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976. [Moy]                                                          [Page 71]
  3977.  
  3978. Internet Draft               OSPF Version 2                November 1992
  3979.  
  3980.  
  3981.         communication between neighbors.  The graph in Figure  13  shows
  3982.         the  forming of an adjacency.  Not every two neighboring routers
  3983.         become adjacent (see Section 10.4).   The  adjacency  starts  to
  3984.         form  when  the  neighbor  is  in  state ExStart.  After the two
  3985.         routers discover their master/slave status,  the  state  transi-
  3986.         tions to Exchange.  At this point the neighbor starts to be used
  3987.         in the flooding procedure, and the two neighboring routers begin
  3988.         synchronizing  their  databases.   When  this synchronization is
  3989.         finished, the neighbor is in state Full and we say that the  two
  3990.         routers  are  fully  adjacent.   At  this point the adjacency is
  3991.         listed in link state advertisements.
  3992.  
  3993.         For a more  detailed  description  of  neighbor  state  changes,
  3994.         together  with  the  additional actions involved in each change,
  3995.         see Section 10.3.
  3996.  
  3997.  
  3998.  
  3999.  
  4000.                                   +-------+
  4001.                                   |ExStart|
  4002.                                   +-------+
  4003.                                     |
  4004.                              NegDone|
  4005.                                     +->+--------+
  4006.                                        |Exchange|
  4007.                                     +--+--------+
  4008.                                     |
  4009.                             Exchange|
  4010.                               Done  |
  4011.                     +----+          |      +-------+
  4012.                     |Full|<---------+----->|Loading|
  4013.                     +----+<-+              +-------+
  4014.                             |  LoadingDone     |
  4015.                             +------------------+
  4016.  
  4017.             Figure 13: Neighbor state changes (Database Exchange)
  4018.  
  4019.                 In addition to the state transitions pictured,
  4020.                 Event SeqNumberMismatch forces Exstart state,
  4021.                 Event BadLSReq forces Exstart state,
  4022.                 Event 1-Way forces Init state,
  4023.                 Event KillNbr always forces Down State,
  4024.                 Event InactivityTimer always forces Down State,
  4025.                 Event LLDown always forces Down State,
  4026.                 Event AdjOK? leads to adjacency forming/breaking
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032. [Moy]                                                          [Page 72]
  4033.  
  4034. Internet Draft               OSPF Version 2                November 1992
  4035.  
  4036.  
  4037.         Down
  4038.             This is the initial state of a  neighbor  conversation.   It
  4039.             indicates that there has been no recent information received
  4040.             from the neighbor.  On non-broadcast networks, Hello packets
  4041.             may still be sent to "Down" neighbors, although at a reduced
  4042.             frequency (see Section 9.5.1).
  4043.  
  4044.         Attempt
  4045.             This state is only valid  for  neighbors  attached  to  non-
  4046.             broadcast networks.  It indicates that no recent information
  4047.             has been received from the neighbor, but that  a  more  con-
  4048.             certed  effort should be made to contact the neighbor.  This
  4049.             is done by sending the neighbor Hello packets  at  intervals
  4050.             of HelloInterval (see Section 9.5.1).
  4051.  
  4052.         Init
  4053.             In this state, an Hello packet has recently been  seen  from
  4054.             the  neighbor.  However, bidirectional communication has not
  4055.             yet been established with the  neighbor  (i.e.,  the  router
  4056.             itself  did not appear in the neighbor's Hello packet).  All
  4057.             neighbors in this state (or higher) are listed in the  Hello
  4058.             packets sent from the associated interface.
  4059.  
  4060.         2-Way
  4061.             In this state, communication  between  the  two  routers  is
  4062.             bidirectional.   This  has  been assured by the operation of
  4063.             the Hello Protocol.  This is the most advanced  state  short
  4064.             of  beginning  adjacency establishment.  The (Backup) Desig-
  4065.             nated Router is selected from the set of neighbors in  state
  4066.             2-Way or greater.
  4067.  
  4068.         ExStart
  4069.             This is the first step in creating an adjacency between  the
  4070.             two neighboring routers.  The goal of this step is to decide
  4071.             which router is the master, and to decide upon  the  initial
  4072.             sequence  number.   Neighbor  conversations in this state or
  4073.             greater are called adjacencies.
  4074.  
  4075.         Exchange
  4076.             In this state the router is describing its entire link state
  4077.             database  by  sending  Database  Description  packets to the
  4078.             neighbor.  Each Database Description Packet has  a  sequence
  4079.             number,  and  is explicitly acknowledged.  Only one Database
  4080.             Description Packet is allowed outstanding at any  one  time.
  4081.             In  this  state, Link State Request Packets may also be sent
  4082.             asking for the neighbor's more recent  advertisements.   All
  4083.             adjacencies  in  Exchange  state  or greater are used by the
  4084.             flooding procedure.  In fact, these  adjacencies  are  fully
  4085.  
  4086.  
  4087.  
  4088. [Moy]                                                          [Page 73]
  4089.  
  4090. Internet Draft               OSPF Version 2                November 1992
  4091.  
  4092.  
  4093.             capable  of  transmitting  and  receiving  all types of OSPF
  4094.             routing protocol packets.
  4095.  
  4096.         Loading
  4097.             In this state, Link State Request packets are  sent  to  the
  4098.             neighbor asking for the more recent advertisements that have
  4099.             been discovered (but  not  yet  received)  in  the  Exchange
  4100.             state.
  4101.  
  4102.         Full
  4103.             In this state, the neighboring routers are  fully  adjacent.
  4104.             These  adjacencies  will now appear in router links and net-
  4105.             work links advertisements.
  4106.  
  4107.  
  4108.     10.2.  Events causing neighbor state changes
  4109.  
  4110.         State changes can be effected by  a  number  of  events.   These
  4111.         events are shown in the labels of the arcs in Figures 12 and 13.
  4112.         The label definitions are as follows:
  4113.  
  4114.  
  4115.         Hello Received
  4116.             A Hello packet has been received from a neighbor.
  4117.  
  4118.         Start
  4119.             This is an indication that Hello Packets should now be  sent
  4120.             to the neighbor at intervals of HelloInterval seconds.  This
  4121.             event is generated only for neighbors associated  with  non-
  4122.             broadcast networks.
  4123.  
  4124.         2-Way Received
  4125.             Bidirectional communication has been  realized  between  the
  4126.             two  neighboring  routers.  This is indicated by this router
  4127.             seeing itself in the other's Hello packet.
  4128.  
  4129.         NegotiationDone
  4130.             The  Master/Slave  relationship  has  been  negotiated,  and
  4131.             sequence  numbers  have  been  exchanged.   This signals the
  4132.             start of the sending/receiving of Database Description pack-
  4133.             ets.   For more information on the generation of this event,
  4134.             consult Section 10.8.
  4135.  
  4136.         Exchange Done
  4137.             Both routers have successfully transmitted a  full  sequence
  4138.             of Database Description packets.  Each router now knows what
  4139.             parts of its link state database are out of date.  For  more
  4140.             information on the generation of this event, consult Section
  4141.  
  4142.  
  4143.  
  4144. [Moy]                                                          [Page 74]
  4145.  
  4146. Internet Draft               OSPF Version 2                November 1992
  4147.  
  4148.  
  4149.             10.8.
  4150.  
  4151.         BadLSReq
  4152.             A Link State Request has been  received  for  a  link  state
  4153.             advertisement not contained in the database.  This indicates
  4154.             an error in the synchronization process.
  4155.  
  4156.         Loading Done
  4157.             Link State Updates have been received  for  all  out-of-date
  4158.             portions  of  the  database.   This is indicated by the Link
  4159.             state  request  list  becoming  empty  after  the   Database
  4160.             Description Process has completed.
  4161.  
  4162.         AdjOK?
  4163.             A decision must be made (again) as to whether  an  adjacency
  4164.             should  be  established/maintained  with the neighbor.  This
  4165.             event will start some adjacencies forming, and destroy  oth-
  4166.             ers.
  4167.  
  4168.  
  4169.         The following events cause well developed neighbors to revert to
  4170.         lesser  states.  Unlike the above events, these events may occur
  4171.         when the neighbor conversation is in any of a number of states.
  4172.  
  4173.  
  4174.         Seq Number Mismatch
  4175.             A Database Description packet has been received that  either
  4176.             a)  has  an  unexpected sequence number, b) unexpectedly has
  4177.             the Init bit set or c) has an Options field  differing  from
  4178.             the  last  Options  field received in a Database Description
  4179.             packet.  Any of these conditions indicate  that  some  error
  4180.             has occurred during adjacency establishment.
  4181.  
  4182.         1-Way
  4183.             An Hello packet has been  received  from  the  neighbor,  in
  4184.             which  this  router  is  not mentioned.  This indicates that
  4185.             communication with the neighbor is not bidirectional.
  4186.  
  4187.         KillNbr
  4188.             This  is  an  indication that  all  communication  with  the
  4189.             neighbor   is  now   impossible,  forcing  the  neighbor  to
  4190.             revert  to  Down  state.
  4191.  
  4192.         Inactivity Timer
  4193.             The inactivity Timer has fired.  This means  that  no  Hello
  4194.             packets  have  been  seen  recently  from the neighbor.  The
  4195.             neighbor reverts to Down state.
  4196.  
  4197.  
  4198.  
  4199.  
  4200. [Moy]                                                          [Page 75]
  4201.  
  4202. Internet Draft               OSPF Version 2                November 1992
  4203.  
  4204.  
  4205.         LLDown
  4206.             This is an indication from the lower  level  protocols  that
  4207.             the  neighbor  is  now unreachable.  For example, on an X.25
  4208.             network this could be indicated by an X.25 clear  indication
  4209.             with  appropriate  cause  and diagnostic fields.  This event
  4210.             forces the neighbor into Down state.
  4211.  
  4212.  
  4213.     10.3.  The Neighbor state machine
  4214.  
  4215.         A detailed description of the neighbor  state  changes  follows.
  4216.         Each  state  change is invoked by an event (Section 10.2).  This
  4217.         event may produce different effects, depending  on  the  current
  4218.         state of the neighbor.  For this reason, the state machine below
  4219.         is organized by current neighbor state and received event.  Each
  4220.         entry  in the state machine describes the resulting new neighbor
  4221.         state and the required set of additional actions.
  4222.  
  4223.         When an neighbor's state changes, it may be necessary  to  rerun
  4224.         the Designated Router election algorithm.  This is determined by
  4225.         whether the interface Neighbor Change event  is  generated  (see
  4226.         Section 9.2).  Also, if the Interface is in DR state (the router
  4227.         is itself Designated Router),  changes  in  neighbor  state  may
  4228.         cause  a  new  network links advertisement to be originated (see
  4229.         Section 12.4).
  4230.  
  4231.         When the neighbor state machine needs to  invoke  the  interface
  4232.         state  machine,  it should be done as a scheduled task (see Sec-
  4233.         tion 4.4).  This simplifies things,  by  ensuring  that  neither
  4234.         state machine will be executed recursively.
  4235.  
  4236.  
  4237.          State(s):  Down
  4238.  
  4239.             Event:  Start
  4240.  
  4241.         New state:  Attempt
  4242.  
  4243.            Action:  Send an hello to  the  neighbor  (this  neighbor  is
  4244.                     always  associated with a non-broadcast network) and
  4245.                     start the inactivity timer for  the  neighbor.   The
  4246.                     timer's  later firing would indicate that communica-
  4247.                     tion with the neighbor was not attained.
  4248.  
  4249.  
  4250.          State(s):  Attempt
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256. [Moy]                                                          [Page 76]
  4257.  
  4258. Internet Draft               OSPF Version 2                November 1992
  4259.  
  4260.  
  4261.             Event:  Hello Received
  4262.  
  4263.         New state:  Init
  4264.  
  4265.            Action:  Restart the inactivity timer for the neighbor, since
  4266.                     the neighbor has now been heard from.
  4267.  
  4268.  
  4269.          State(s):  Down
  4270.  
  4271.             Event:  Hello Received
  4272.  
  4273.         New state:  Init
  4274.  
  4275.            Action:  Start the inactivity timer for  the  neighbor.   The
  4276.                     timer's  later firing would indicate that the neigh-
  4277.                     bor is dead.
  4278.  
  4279.  
  4280.          State(s):  Init or greater
  4281.  
  4282.             Event:  Hello Received
  4283.  
  4284.         New state:  No state change.
  4285.  
  4286.            Action:  Restart the inactivity timer for the neighbor, since
  4287.                     the neighbor has again been heard from.
  4288.  
  4289.  
  4290.          State(s):  Init
  4291.  
  4292.             Event:  2-Way Received
  4293.  
  4294.         New state:  Depends upon action routine.
  4295.  
  4296.            Action:  Determine whether an adjacency should be established
  4297.                     with  the  neighbor (see Section 10.4).  If not, the
  4298.                     new neighbor state is 2-Way.
  4299.  
  4300.                     Otherwise (an adjacency should be  established)  the
  4301.                     neighbor  state transitions to ExStart.  Upon enter-
  4302.                     ing this state, the router increments  the  sequence
  4303.                     number for this neighbor.  If this is the first time
  4304.                     that an adjacency has been attempted,  the  sequence
  4305.                     number  should  be  assigned some unique value (like
  4306.                     the time of day clock).   It  then  declares  itself
  4307.                     master  (sets  the  master/slave bit to master), and
  4308.                     starts sending Database  Description  Packets,  with
  4309.  
  4310.  
  4311.  
  4312. [Moy]                                                          [Page 77]
  4313.  
  4314. Internet Draft               OSPF Version 2                November 1992
  4315.  
  4316.  
  4317.                     the  initialize  (I),  more (M) and master (MS) bits
  4318.                     set.  This Database  Description  Packet  should  be
  4319.                     otherwise  empty.   This Database Description Packet
  4320.                     should be retransmitted at intervals of RxmtInterval
  4321.                     until the next state is entered (see Section 10.8).
  4322.  
  4323.  
  4324.          State(s):  ExStart
  4325.  
  4326.             Event:  NegDone
  4327.  
  4328.         New state:  Exchange
  4329.  
  4330.            Action:  The router must list the contents of its entire area
  4331.                     link state database in the neighbor Database summary
  4332.                     list.  The area link state database consists of  the
  4333.                     router  links,  network links and summary links con-
  4334.                     tained in the area  structure,  along  with  the  AS
  4335.                     external  links  contained  in the global structure.
  4336.                     AS external link advertisements are omitted  from  a
  4337.                     virtual neighbor's Database summary list.  AS exter-
  4338.                     nal advertisements are  omitted  from  the  Database
  4339.                     summary  list  if  the area has been configured as a
  4340.                     stub (see Section 3.6).  Advertisements whose age is
  4341.                     equal  to MaxAge are instead added to the neighbor's
  4342.                     Link state retransmission list.  A  summary  of  the
  4343.                     Database  summary  list will be sent to the neighbor
  4344.                     in  Database  Description  packets.   Each  Database
  4345.                     Description  Packet  has  a  sequence number, and is
  4346.                     explicitly acknowledged.  Only one Database Descrip-
  4347.                     tion  Packet is allowed outstanding at any one time.
  4348.                     For more detail on  the  sending  and  receiving  of
  4349.                     Database  Description packets, see Sections 10.8 and
  4350.                     10.6.
  4351.  
  4352.  
  4353.          State(s):  Exchange
  4354.  
  4355.             Event:  Exchange Done
  4356.  
  4357.         New state:  Depends upon action routine.
  4358.  
  4359.            Action:  If the neighbor Link state request  list  is  empty,
  4360.                     the  new neighbor state is Full.  No other action is
  4361.                     required.  This is an adjacency's final state.
  4362.  
  4363.                     Otherwise, the new neighbor state is Loading.  Start
  4364.                     (or  continue) sending Link State Request packets to
  4365.  
  4366.  
  4367.  
  4368. [Moy]                                                          [Page 78]
  4369.  
  4370. Internet Draft               OSPF Version 2                November 1992
  4371.  
  4372.  
  4373.                     the neighbor (see Section 10.9).  These are requests
  4374.                     for the neighbor's more recent advertisements (which
  4375.                     were discovered but not yet received in the Exchange
  4376.                     state).  These advertisements are listed in the Link
  4377.                     state request list associated with the neighbor.
  4378.  
  4379.  
  4380.          State(s):  Loading
  4381.  
  4382.             Event:  Loading Done
  4383.  
  4384.         New state:  Full
  4385.  
  4386.            Action:  No action required.  This is  an  adjacency's  final
  4387.                     state.
  4388.  
  4389.  
  4390.          State(s):  2-Way
  4391.  
  4392.             Event:  AdjOK?
  4393.  
  4394.         New state:  Depends upon action routine.
  4395.  
  4396.            Action:  Determine whether an adjacency should be formed with
  4397.                     the  neighboring router (see Section 10.4).  If not,
  4398.                     the neighbor state  remains  at  2-Way.   Otherwise,
  4399.                     transition the neighbor state to ExStart and perform
  4400.                     the actions associated with the above state  machine
  4401.                     entry for state Init and event 2-Way Received.
  4402.  
  4403.  
  4404.          State(s):  ExStart or greater
  4405.  
  4406.             Event:  AdjOK?
  4407.  
  4408.         New state:  Depends upon action routine.
  4409.  
  4410.            Action:  Determine  whether  the  neighboring  router  should
  4411.                     still be adjacent.  If yes, there is no state change
  4412.                     and no further action is necessary.
  4413.  
  4414.                     Otherwise, the (possibly partially formed) adjacency
  4415.                     must  be  destroyed.  The neighbor state transitions
  4416.                     to 2-Way.  The Link state retransmission list, Data-
  4417.                     base  summary  list  and Link state request list are
  4418.                     cleared of link state advertisements.
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424. [Moy]                                                          [Page 79]
  4425.  
  4426. Internet Draft               OSPF Version 2                November 1992
  4427.  
  4428.  
  4429.          State(s):  Exchange or greater
  4430.  
  4431.             Event:  Seq Number Mismatch
  4432.  
  4433.         New state:  ExStart
  4434.  
  4435.            Action:  The (possibly partially formed)  adjacency  is  torn
  4436.                     down,  and  then  an attempt is made at reestablish-
  4437.                     ment.   The  neighbor  state  first  transitions  to
  4438.                     ExStart.   The Link state retransmission list, Data-
  4439.                     base summary list and Link state  request  list  are
  4440.                     cleared  of  link  state  advertisements.   Then the
  4441.                     router  increments  the  sequence  number  for  this
  4442.                     neighbor,   declares   itself   master   (sets   the
  4443.                     master/slave bit  to  master),  and  starts  sending
  4444.                     Database  Description  Packets,  with the initialize
  4445.                     (I), more (M) and master (MS) bits set.  This  Data-
  4446.                     base  Description  Packet  should be otherwise empty
  4447.                     (see Section 10.8).
  4448.  
  4449.  
  4450.          State(s):  Exchange or greater
  4451.  
  4452.             Event:  BadLSReq
  4453.  
  4454.         New state:  ExStart
  4455.  
  4456.            Action:  The action for event BadLSReq is exactly the same as
  4457.                     for the neighbor event SeqNumberMismatch.  The (pos-
  4458.                     sibly partially formed) adjacency is torn down,  and
  4459.                     then  an  attempt  is  made at reestablishment.  For
  4460.                     more information, see  the  neighbor  state  machine
  4461.                     entry  that  is invoked when event SeqNumberMismatch
  4462.                     is generated in state Exchange or greater.
  4463.  
  4464.  
  4465.          State(s):  Any state
  4466.  
  4467.             Event:  KillNbr
  4468.  
  4469.         New state:  Down
  4470.  
  4471.            Action:  The Link state retransmission list, Database summary
  4472.                     list and Link state request list are cleared of link
  4473.                     state advertisements.  Also, the inactivity timer is
  4474.                     disabled.
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480. [Moy]                                                          [Page 80]
  4481.  
  4482. Internet Draft               OSPF Version 2                November 1992
  4483.  
  4484.  
  4485.          State(s):  Any state
  4486.  
  4487.             Event:  LLDown
  4488.  
  4489.         New state:  Down
  4490.  
  4491.            Action:  The Link state retransmission list, Database summary
  4492.                     list and Link state request list are cleared of link
  4493.                     state advertisements.  Also, the inactivity timer is
  4494.                     disabled.
  4495.  
  4496.  
  4497.          State(s):  Any state
  4498.  
  4499.             Event:  Inactivity Timer
  4500.  
  4501.         New state:  Down
  4502.  
  4503.            Action:  The Link state retransmission list, Database summary
  4504.                     list and Link state request list are cleared of link
  4505.                     state advertisements.
  4506.  
  4507.  
  4508.          State(s):  2-Way or greater
  4509.  
  4510.             Event:  1-Way Received
  4511.  
  4512.         New state:  Init
  4513.  
  4514.            Action:  The Link state retransmission list, Database summary
  4515.                     list and Link state request list are cleared of link
  4516.                     state advertisements.
  4517.  
  4518.  
  4519.          State(s):  2-Way or greater
  4520.  
  4521.             Event:  2-Way received
  4522.  
  4523.         New state:  No state change.
  4524.  
  4525.            Action:  No action required.
  4526.  
  4527.  
  4528.          State(s):  Init
  4529.  
  4530.             Event:  1-Way received
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536. [Moy]                                                          [Page 81]
  4537.  
  4538. Internet Draft               OSPF Version 2                November 1992
  4539.  
  4540.  
  4541.         New state:  No state change.
  4542.  
  4543.            Action:  No action required.
  4544.  
  4545.  
  4546.     10.4.  Whether to become adjacent
  4547.  
  4548.         Adjacencies are established with some  subset  of  the  router's
  4549.         neighbors.   Routers  connected  by  point-to-point networks and
  4550.         virtual links always become adjacent.  On multi-access networks,
  4551.         all  routers  become  adjacent to both the Designated Router and
  4552.         the Backup Designated Router.
  4553.  
  4554.         The adjacency-forming decision  occurs  in  two  places  in  the
  4555.         neighbor state machine.  First, when bidirectional communication
  4556.         is initially established with the neighbor, and  secondly,  when
  4557.         the  identity  of  the  attached  network's  (Backup) Designated
  4558.         Router changes.  If the decision is made to not attempt an adja-
  4559.         cency, the state of the neighbor communication stops at 2-Way.
  4560.  
  4561.         An adjacency should be established with a (bidirectional) neigh-
  4562.         bor when at least one of the following conditions holds:
  4563.  
  4564.  
  4565.         o   The underlying network type is point-to-point
  4566.  
  4567.         o   The underlying network type is virtual link
  4568.  
  4569.         o   The router itself is the Designated Router
  4570.  
  4571.         o   The router itself is the Backup Designated Router
  4572.  
  4573.         o   The neighboring router is the Designated Router
  4574.  
  4575.         o   The neighboring router is the Backup Designated Router
  4576.  
  4577.  
  4578.     10.5.  Receiving Hello packets
  4579.  
  4580.         This section explains the  detailed  processing  of  a  received
  4581.         Hello  packet.  (See Section A.3.2 for the format of Hello pack-
  4582.         ets.)  The generic input processing of OSPF  packets  will  have
  4583.         checked  the  validity  of  the  IP  header  and the OSPF packet
  4584.         header.  Next, the values of the  Network  Mask,  HelloInt,  and
  4585.         DeadInt  fields  in  the  received  Hello packet must be checked
  4586.         against the values configured for the receiving interface.   Any
  4587.         mismatch causes processing to stop and the packet to be dropped.
  4588.         In other words, the  above  fields  are  really  describing  the
  4589.  
  4590.  
  4591.  
  4592. [Moy]                                                          [Page 82]
  4593.  
  4594. Internet Draft               OSPF Version 2                November 1992
  4595.  
  4596.  
  4597.         attached  network's  configuration.   Note that the value of the
  4598.         Network Mask field should not be checked in Hellos  received  on
  4599.         unnumbered serial lines or on virtual links.
  4600.  
  4601.         The receiving interface attaches to a  single  OSPF  area  (this
  4602.         could  be  the backbone).  The setting of the E-bit found in the
  4603.         Hello Packet's option field  must  match  this  area's  external
  4604.         routing  capability.   If  AS  external  advertisements  are not
  4605.         flooded into/throughout the area (i.e, the area is a "stub") the
  4606.         E-bit must be clear in received hellos, otherwise the E-bit must
  4607.         be set.  A mismatch causes processing to stop and the packet  to
  4608.         be  dropped.   The  setting of the rest of the bits in the Hello
  4609.         Packet's option field should be ignored.
  4610.  
  4611.         At this point, an attempt is made to match  the  source  of  the
  4612.         Hello  Packet to one of the receiving interface's neighbors.  If
  4613.         the receiving interface is a multi-access network (either broad-
  4614.         cast or non-broadcast) the source is identified by the IP source
  4615.         address found in the Hello's IP header.  If the receiving inter-
  4616.         face  is  a point-to-point link or a virtual link, the source is
  4617.         identified by the Router ID found in  the  Hello's  OSPF  packet
  4618.         header.   The interface's current list of neighbors is contained
  4619.         in the interface's  data  structure.   If  a  matching  neighbor
  4620.         structure  cannot  be  found,  (i.e., this is the first time the
  4621.         neighbor has been detected), one is created.  The initial  state
  4622.         of a newly created neighbor is set to Down.
  4623.  
  4624.         When receiving an Hello Packet from a neighbor on a multi-access
  4625.         network   (broadcast   or   non-broadcast),   set  the  neighbor
  4626.         structure's Neighbor ID equal to the  Router  ID  found  in  the
  4627.         packet's  OSPF  header.   When receiving an Hello on a point-to-
  4628.         point network (but not on  a  virtual  link)  set  the  neighbor
  4629.         structure's  Neighbor  IP  address  to  the  packet's  IP source
  4630.         address.
  4631.  
  4632.         Now the rest of the Hello Packet is examined, generating  events
  4633.         to be given to the neighbor and interface state machines.  These
  4634.         state machines are specified either to be executed or  scheduled
  4635.         (see  Section  4.4).   For example, by specifying below that the
  4636.         neighbor state machine be executed  in  line,  several  neighbor
  4637.         state transitions may be effected by a single received Hello:
  4638.  
  4639.  
  4640.         o   Each Hello Packet causes the neighbor state  machine  to  be
  4641.             executed with the event Hello Received.
  4642.  
  4643.         o   Then the list of neighbors contained in the Hello Packet  is
  4644.             examined.   If  the  router itself appears in this list, the
  4645.  
  4646.  
  4647.  
  4648. [Moy]                                                          [Page 83]
  4649.  
  4650. Internet Draft               OSPF Version 2                November 1992
  4651.  
  4652.  
  4653.             neighbor state machine should be executed with the event  2-
  4654.             Way  Received.  Otherwise, the neighbor state machine should
  4655.             be executed with the event 1-Way Received, and the  process-
  4656.             ing of the packet stops.
  4657.  
  4658.         o   Next, the Hello packet's Router Priority field is  examined.
  4659.             If  this field is different than the one previously received
  4660.             from the neighbor, the receiving interface's  state  machine
  4661.             is  scheduled  with  the event NeighborChange.  In any case,
  4662.             the Router Priority field in  the  neighbor  data  structure
  4663.             should be set accordingly.
  4664.  
  4665.         o   Next the Designated Router field  in  the  Hello  Packet  is
  4666.             examined.   If  the  neighbor is both declaring itself to be
  4667.             Designated Router (Designated Router  field  =  neighbor  IP
  4668.             address)  and  the  Backup  Designated  Router  field in the
  4669.             packet is equal to 0.0.0.0 and the receiving interface is in
  4670.             state  Waiting,  the  receiving interface's state machine is
  4671.             scheduled with the  event  BackupSeen.   Otherwise,  if  the
  4672.             neighbor  is declaring itself to be Designated Router and it
  4673.             had not previously, or the neighbor is not declaring  itself
  4674.             Designated  Router  where  it  had previously, the receiving
  4675.             interface's state machine is scheduled with the event Neigh-
  4676.             borChange.   In  any case, the Designated Router item in the
  4677.             neighbor structure is set accordingly.
  4678.  
  4679.         o   Finally, the Backup Designated Router  field  in  the  Hello
  4680.             Packet  is examined.  If the neighbor is declaring itself to
  4681.             be Backup Designated Router (Backup Designated Router  field
  4682.             =  neighbor  IP  address)  and the receiving interface is in
  4683.             state Waiting, the receiving interface's  state  machine  is
  4684.             scheduled  with  the  event  BackupSeen.   Otherwise, if the
  4685.             neighbor is declaring itself to be Backup Designated  Router
  4686.             and  it had not previously, or the neighbor is not declaring
  4687.             itself Backup Designated Router where it had previously, the
  4688.             receiving  interface's  state  machine is scheduled with the
  4689.             event NeighborChange.  In any case,  the  Backup  Designated
  4690.             Router item in the neighbor structure is set accordingly.
  4691.  
  4692.  
  4693.     10.6.  Receiving Database Description Packets
  4694.  
  4695.         This section explains the  detailed  processing  of  a  received
  4696.         Database  Description packet.  The incoming Database Description
  4697.         Packet has already been associated with a neighbor and receiving
  4698.         interface  by the generic input packet processing (Section 8.2).
  4699.         The  further  processing  of  the  Database  Description  Packet
  4700.         depends  on the neighbor state.  If the neighbor's state is Down
  4701.  
  4702.  
  4703.  
  4704. [Moy]                                                          [Page 84]
  4705.  
  4706. Internet Draft               OSPF Version 2                November 1992
  4707.  
  4708.  
  4709.         or Attempt the packet should  be  ignored.   Otherwise,  if  the
  4710.         state is:
  4711.  
  4712.  
  4713.         Init
  4714.             The neighbor state machine should be executed with the event
  4715.             2-Way  Received.   This  causes an immediate state change to
  4716.             either state 2-Way or state Exstart.  The processing of  the
  4717.             current packet should then continue in this new state.
  4718.  
  4719.         2-Way
  4720.             The packet should be ignored.  Database description  packets
  4721.             are used only for the purpose of bringing up adjacencies.[7]
  4722.  
  4723.         ExStart
  4724.             If the received packet matches one of the  following  cases,
  4725.             then  the neighbor state machine should be executed with the
  4726.             event NegotiationDone (causing the state  to  transition  to
  4727.             Exchange),  the packet's Options field should be recorded in
  4728.             the neighbor structure's  Neighbor  Options  field  and  the
  4729.             packet  should be accepted as next in sequence and processed
  4730.             further  (see  below).   Otherwise,  the  packet  should  be
  4731.             ignored.
  4732.  
  4733.             o   The initialize(I), more (M) and master(MS) bits are set,
  4734.                 the contents of the packet are empty, and the neighbor's
  4735.                 Router ID is larger than the router's own.  In this case
  4736.                 the  router  is  now Slave.  Set the master/slave bit to
  4737.                 slave, and set the sequence number to that specified  by
  4738.                 the master.
  4739.  
  4740.             o   The initialize(I)  and  master(MS)  bits  are  off,  the
  4741.                 packet's   sequence   number  equals  the  router's  own
  4742.                 sequence  number  (indicating  acknowledgment)  and  the
  4743.                 neighbor's  Router  ID is smaller than the router's own.
  4744.                 In this case the router is Master.
  4745.  
  4746.         Exchange
  4747.             If  the  state  of  the  MS-bit  is  inconsistent  with  the
  4748.             master/slave  state of the connection, generate the neighbor
  4749.             event Seq Number Mismatch and stop  processing  the  packet.
  4750.             Otherwise:
  4751.  
  4752.             o   If the initialize(I) bit is set, generate  the  neighbor
  4753.                 event  Seq  Number  Mismatch  and  stop  processing  the
  4754.                 packet.
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760. [Moy]                                                          [Page 85]
  4761.  
  4762. Internet Draft               OSPF Version 2                November 1992
  4763.  
  4764.  
  4765.             o   If the packet's Options field indicates a different  set
  4766.                 of  optional  OSPF  capabilities  than  were  previously
  4767.                 received from the neighbor  (recorded  in  the  Neighbor
  4768.                 Options  field  of the neighbor structure), generate the
  4769.                 neighbor event Seq Number Mismatch and  stop  processing
  4770.                 the packet.
  4771.  
  4772.             o   If the router  is  master,  and  the  packet's  sequence
  4773.                 number  equals  the  router's  own sequence number (this
  4774.                 packet is the next in sequence)  the  packet  should  be
  4775.                 accepted and its contents processed (below).
  4776.  
  4777.             o   If the router  is  master,  and  the  packet's  sequence
  4778.                 number  is  one  less than the router's sequence number,
  4779.                 the packet is a duplicate.  Duplicates  should  be  dis-
  4780.                 carded by the master.
  4781.  
  4782.             o   If the router is slave, and the packet's sequence number
  4783.                 is  one more than the router's own sequence number (this
  4784.                 packet is the next in sequence)  the  packet  should  be
  4785.                 accepted and its contents processed (below).
  4786.  
  4787.             o   If the router is slave, and the packet's sequence number
  4788.                 is  equal to the router's sequence number, the packet is
  4789.                 a duplicate.  The slave must respond  to  duplicates  by
  4790.                 repeating  the  last Database Description packet that it
  4791.                 sent.
  4792.  
  4793.             o   Else, generate the neighbor event  Seq  Number  Mismatch
  4794.                 and stop processing the packet.
  4795.  
  4796.         Loading or Full
  4797.             In this state, the router has sent and  received  an  entire
  4798.             sequence   of   Database  Descriptions.   The  only  packets
  4799.             received should be duplicates (see above).   In  particular,
  4800.             the  packet's Options field should match the set of optional
  4801.             OSPF  capabilities  previously  indicated  by  the  neighbor
  4802.             (stored in the neighbor structure's neighbor Options field).
  4803.             Any other packets received, including  the  reception  of  a
  4804.             packet  with  the Initialize(I) bit set, should generate the
  4805.             neighbor event Seq Number Mismatch.[8] Duplicates should  be
  4806.             discarded  by  the master.  The slave must respond to dupli-
  4807.             cates by repeating the last Database Description packet that
  4808.             it sent.
  4809.  
  4810.  
  4811.         When the router accepts a received Database  Description  Packet
  4812.         as  the  next  in  sequence the packet contents are processed as
  4813.  
  4814.  
  4815.  
  4816. [Moy]                                                          [Page 86]
  4817.  
  4818. Internet Draft               OSPF Version 2                November 1992
  4819.  
  4820.  
  4821.         follows.   For  each  link  state  advertisement   listed,   the
  4822.         advertisement's LS type is checked for validity.  If the LS type
  4823.         is unknown (e.g., not one of the LS types 1-5  defined  by  this
  4824.         specification),  or  if  this is a AS external advertisement (LS
  4825.         type = 5) and the neighbor is associated with a stub area,  gen-
  4826.         erate the neighbor event Seq Number Mismatch and stop processing
  4827.         the packet.  Otherwise, the router looks up the advertisement in
  4828.         its  database to see whether it also has an instance of the link
  4829.         state advertisement.  If it does not, or if the database copy is
  4830.         less  recent (see Section 13.1), the link state advertisement is
  4831.         put on the Link state request list so that it can  be  requested
  4832.         (immediately  or at some later time) in Link State Request Pack-
  4833.         ets.
  4834.  
  4835.         When the router accepts a received Database  Description  Packet
  4836.         as the next in sequence, it also performs the following actions,
  4837.         depending on whether it is master or slave:
  4838.  
  4839.  
  4840.         Master
  4841.             Increments the sequence number.  If the router  has  already
  4842.             sent  its  entire sequence of Database Descriptions, and the
  4843.             just accepted packet has the more bit  (M)  set  to  0,  the
  4844.             neighbor  event  Exchange  Done is generated.  Otherwise, it
  4845.             should send a new Database Description to the slave.
  4846.  
  4847.         Slave
  4848.             Sets the sequence number to the sequence number appearing in
  4849.             the  received  packet.   The  slave  must  send  a  Database
  4850.             Description in reply.  If the received packet has  the  more
  4851.             bit  (M)  set  to  0, and the packet to be sent by the slave
  4852.             will have the M-bit  set  to  0  also,  the  neighbor  event
  4853.             Exchange Done is generated.  Note that the slave always gen-
  4854.             erates this event before the master.
  4855.  
  4856.  
  4857.     10.7.  Receiving Link State Request Packets
  4858.  
  4859.         This section explains the detailed processing of  received  Link
  4860.         State  Request  packets.   Received  Link  State Request Packets
  4861.         specify a list of link state advertisements  that  the  neighbor
  4862.         wishes  to  receive.   Link  state  Request  Packets  should  be
  4863.         accepted when the neighbor is in states  Exchange,  Loading,  or
  4864.         Full.   In all other states Link State Request Packets should be
  4865.         ignored.
  4866.  
  4867.         Each link  state  advertisement  specified  in  the  Link  State
  4868.         Request  packet  should be located in the router's database, and
  4869.  
  4870.  
  4871.  
  4872. [Moy]                                                          [Page 87]
  4873.  
  4874. Internet Draft               OSPF Version 2                November 1992
  4875.  
  4876.  
  4877.         copied into Link State Update packets for  transmission  to  the
  4878.         neighbor.   These link state advertisements should NOT be placed
  4879.         on the Link state retransmission list for the  neighbor.   If  a
  4880.         link  state advertisement cannot be found in the database, some-
  4881.         thing has gone wrong with  the  synchronization  procedure,  and
  4882.         neighbor event BadLSReq should be generated.
  4883.  
  4884.  
  4885.     10.8.  Sending Database Description Packets
  4886.  
  4887.         This section describes how Database Description Packets are sent
  4888.         to  a  neighbor.   The  router's optional OSPF capabilities (see
  4889.         Section 4.5) are transmitted to  the  neighbor  in  the  Options
  4890.         field  of  the  Database  Description packet.  The router should
  4891.         maintain the same set of optional  capabilities  throughout  the
  4892.         Database  Exchange  and flooding procedures.  If for some reason
  4893.         the router's optional capabilities change, the Database Exchange
  4894.         procedure  should  be  restarted  by reverting to neighbor state
  4895.         ExStart.  There are currently two optional capabilities defined.
  4896.         The  T-bit should be set if and only if the router is capable of
  4897.         calculating separate routes for each IP TOS.  The  E-bit  should
  4898.         be set if and only if the attached network belongs to a non-stub
  4899.         area.  The rest of the Options field should be set to zero.
  4900.  
  4901.         The sending of  Database  Description  packets  depends  on  the
  4902.         neighbor's state.  In state ExStart the router sends empty Data-
  4903.         base Description packets, with the initialize (I), more (M)  and
  4904.         master  (MS)  bits  set.   These packets are retransmitted every
  4905.         RxmtInterval seconds.
  4906.  
  4907.         In state Exchange the Database Description Packets actually con-
  4908.         tain  summaries  of  the link state information contained in the
  4909.         router's database.  Each link state advertisement in the  area's
  4910.         topological  database (at the time the neighbor transitions into
  4911.         Exchange state) is listed in the neighbor Database summary list.
  4912.         When  a  new  Database  Description  Packet  is  to be sent, the
  4913.         packet's sequence number is incremented, and the  (new)  top  of
  4914.         the Database summary list is described by the packet.  Items are
  4915.         removed from the Database summary list when the previous  packet
  4916.         is acknowledged.
  4917.  
  4918.         In state Exchange, the determination of when to  send  a  packet
  4919.         depends on whether the router is master or slave:
  4920.  
  4921.  
  4922.         Master
  4923.             Packets are sent when either a) the slave  acknowledges  the
  4924.             previous  packet  by  echoing  the  sequence  number  or  b)
  4925.  
  4926.  
  4927.  
  4928. [Moy]                                                          [Page 88]
  4929.  
  4930. Internet Draft               OSPF Version 2                November 1992
  4931.  
  4932.  
  4933.             RxmtInterval seconds elapse without  an  acknowledgment,  in
  4934.             which case the previous packet is retransmitted.
  4935.  
  4936.         Slave
  4937.             Packets are sent only in response to packets  received  from
  4938.             the  master.  If the packet received from the master is new,
  4939.             a new packet is  sent,  otherwise  the  previous  packet  is
  4940.             resent.
  4941.  
  4942.  
  4943.         In states Loading and Full the slave must resend its last packet
  4944.         in  response to duplicate packets received from the master.  For
  4945.         this reason  the  slave  must  wait  RouterDeadInterval  seconds
  4946.         before  freeing the last packet.  Reception of a packet from the
  4947.         master after this interval will generate a Seq  Number  Mismatch
  4948.         neighbor event.
  4949.  
  4950.  
  4951.     10.9.  Sending Link State Request Packets
  4952.  
  4953.         In neighbor states Exchange or Loading, the Link  state  request
  4954.         list  contains  a  list  of those link state advertisements that
  4955.         need to be obtained from the neighbor.  To request these  adver-
  4956.         tisements, a router sends the neighbor the beginning of the Link
  4957.         state request list, packaged in a Link State Request packet.
  4958.  
  4959.         When the neighbor responds to these  requests  with  the  proper
  4960.         Link  State  Update  packet(s),  the  Link state request list is
  4961.         truncated and a new Link State Request  packet  is  sent.   This
  4962.         process  continues  until  the  link  state request list becomes
  4963.         empty.  Unsatisfied Link State  Requests  are  retransmitted  at
  4964.         intervals  of  RxmtInterval.   There  should be at most one Link
  4965.         State Request packet outstanding at any one time.
  4966.  
  4967.         When the Link state request list becomes empty, and the neighbor
  4968.         state is Loading (i.e., a complete sequence of Database Descrip-
  4969.         tion packets has been received from the neighbor),  the  Loading
  4970.         Done neighbor event is generated.
  4971.  
  4972.  
  4973.     10.10.  An Example
  4974.  
  4975.         Figure 14 shows an example of an adjacency forming.  Routers RT1
  4976.         and  RT2  are  both  connected  to  a  broadcast network.  It is
  4977.         assumed that RT2 is the Designated Router for the  network,  and
  4978.         that RT2 has a higher Router ID that router RT1.
  4979.  
  4980.         The neighbor state changes realized by each router are listed on
  4981.  
  4982.  
  4983.  
  4984. [Moy]                                                          [Page 89]
  4985.  
  4986. Internet Draft               OSPF Version 2                November 1992
  4987.  
  4988.  
  4989.  
  4990.             +---+                                         +---+
  4991.             |RT1|                                         |RT2|
  4992.             +---+                                         +---+
  4993.  
  4994.             Down                                          Down
  4995.                             Hello(DR=0,seen=0)
  4996.                        ------------------------------>
  4997.                          Hello (DR=RT2,seen=RT1,...)      Init
  4998.                        <------------------------------
  4999.             ExStart        D-D (Seq=x,I,M,Master)
  5000.                        ------------------------------>
  5001.                            D-D (Seq=y,I,M,Master)         ExStart
  5002.                        <------------------------------
  5003.             Exchange       D-D (Seq=y,M,Slave)
  5004.                        ------------------------------>
  5005.                            D-D (Seq=y+1,M,Master)         Exchange
  5006.                        <------------------------------
  5007.                            D-D (Seq=y+1,M,Slave)
  5008.                        ------------------------------>
  5009.                                      ...
  5010.                                      ...
  5011.                                      ...
  5012.                            D-D (Seq=y+n, Master)
  5013.                        <------------------------------
  5014.                            D-D (Seq=y+n, Slave)
  5015.              Loading   ------------------------------>
  5016.                                  LS Request                Full
  5017.                        ------------------------------>
  5018.                                  LS Update
  5019.                        <------------------------------
  5020.                                  LS Request
  5021.                        ------------------------------>
  5022.                                  LS Update
  5023.                        <------------------------------
  5024.              Full
  5025.  
  5026.  
  5027.                    Figure 14: An adjacency bring-up example
  5028.  
  5029.         the sides of the figure.
  5030.  
  5031.         At the beginning of Figure 14, router  RT1's  interface  to  the
  5032.         network becomes operational.  It begins sending hellos, although
  5033.         it doesn't know the identity of the Designated Router or of  any
  5034.         other  neighboring routers.  Router RT2 hears this hello (moving
  5035.         the neighbor to Init state), and in  its  next  hello  indicates
  5036.         that  it  is  itself the Designated Router and that it has heard
  5037.  
  5038.  
  5039.  
  5040. [Moy]                                                          [Page 90]
  5041.  
  5042. Internet Draft               OSPF Version 2                November 1992
  5043.  
  5044.  
  5045.         hellos from RT1.  This  in  turn  causes  RT1  to  go  to  state
  5046.         ExStart, as it starts to bring up the adjacency.
  5047.  
  5048.         RT1 begins by asserting itself as the master.  When it sees that
  5049.         RT2  is  indeed  the master (because of RT2's higher Router ID),
  5050.         RT1  transitions  to  slave  state  and  adopts  its  neighbor's
  5051.         sequence   number.    Database   Description  packets  are  then
  5052.         exchanged, with polls coming from the master (RT2) and responses
  5053.         from  the  slave  (RT1).   This sequence of Database Description
  5054.         Packets ends when both the poll and associated response has  the
  5055.         M-bit off.
  5056.  
  5057.         In this example, it is assumed that RT2 has a completely  up  to
  5058.         date  database.   In  that  case, RT2 goes immediately into Full
  5059.         state.  RT1 will go into Full state after updating the necessary
  5060.         parts  of  its  database.   This  is  done by sending Link State
  5061.         Request Packets, and receiving  Link  State  Update  Packets  in
  5062.         response.   Note that, while RT1 has waited until a complete set
  5063.         of Database Description Packets has  been  received  (from  RT2)
  5064.         before  sending any Link State Request Packets, this need not be
  5065.         the case.  RT1 could have interleaved the sending of Link  State
  5066.         Request Packets with the reception of Database Description Pack-
  5067.         ets.
  5068.  
  5069.  
  5070. 11.  The Routing Table Structure
  5071.  
  5072.     The routing table data structure contains all the information neces-
  5073.     sary  to  forward  an  IP  data packet toward its destination.  Each
  5074.     routing table entry describes the collection of best paths to a par-
  5075.     ticular destination.  When forwarding an IP data packet, the routing
  5076.     table entry providing the best match for the packet's IP destination
  5077.     is located.  The matching routing table entry then provides the next
  5078.     hop towards the packet's destination.  OSPF also  provides  for  the
  5079.     existence  of a default route (Destination ID = DefaultDestination).
  5080.     When the default  route  exists,  it  matches  all  IP  destinations
  5081.     (although  any other matching entry is a better match).  Finding the
  5082.     routing table entry that best matches an IP destination  is  further
  5083.     described in Section 11.1.
  5084.  
  5085.     There is a single routing table in each router.  Two sample  routing
  5086.     tables are described in Sections 11.2 and 11.3.  The building of the
  5087.     routing table is discussed in Section 16.
  5088.  
  5089.     The rest of this section defines the fields found in a routing table
  5090.     entry.   The first set of fields describes the routing table entry's
  5091.     destination.
  5092.  
  5093.  
  5094.  
  5095.  
  5096. [Moy]                                                          [Page 91]
  5097.  
  5098. Internet Draft               OSPF Version 2                November 1992
  5099.  
  5100.  
  5101.     Destination Type
  5102.         The destination can be one of three types.  Only the first type,
  5103.         Network,  is actually used when forwarding IP data traffic.  The
  5104.         other destinations are used solely as intermediate steps in  the
  5105.         routing table build process.
  5106.  
  5107.         Network
  5108.             A range of IP addresses, to which IP  data  traffic  may  be
  5109.             forwarded.  This includes IP networks (class A, B, or C), IP
  5110.             subnets, and single IP hosts.  The default route also  falls
  5111.             in this category.
  5112.  
  5113.         Area border router
  5114.             Routers that are connected to  multiple  OSPF  areas.   Such
  5115.             routers  originate summary link advertisements.  These rout-
  5116.             ing table entries are used when calculating  the  inter-area
  5117.             routes  (see Section 16.2).  These routing table entries may
  5118.             also be associated with configured virtual links.
  5119.  
  5120.         AS boundary router
  5121.             Routers that  originate  AS  external  link  advertisements.
  5122.             These routing table entries are used when calculating the AS
  5123.             external routes (see Section 16.4).
  5124.  
  5125.     Destination ID
  5126.         The destination's identifier  or  name.   This  depends  on  the
  5127.         destination's type.  For networks, the identifier is their asso-
  5128.         ciated IP address.  For all other types, the identifier  is  the
  5129.         OSPF Router ID.[9]
  5130.  
  5131.     Address Mask
  5132.         Only defined for networks.  The network's  IP  address  together
  5133.         with  its  address mask defines a range of IP addresses.  For IP
  5134.         subnets, the address mask is referred to  as  the  subnet  mask.
  5135.         For host routes, the mask is "all ones" (0xffffffff).
  5136.  
  5137.     Optional Capabilities
  5138.         When the destination is a router (either an area  border  router
  5139.         or an AS boundary router) this field indicates the optional OSPF
  5140.         capabilities supported  by  the  destination  router.   The  two
  5141.         optional  capabilities  currently  defined by this specification
  5142.         are the ability to route based on IP TOS and the ability to pro-
  5143.         cess  AS  external  advertisements.  For a further discussion of
  5144.         OSPF's optional capabilities, see Section 4.5.
  5145.  
  5146.  
  5147.     The set of paths to use for a destination may vary based on IP  Type
  5148.     of  Service and the OSPF area to which the paths belong.  This means
  5149.  
  5150.  
  5151.  
  5152. [Moy]                                                          [Page 92]
  5153.  
  5154. Internet Draft               OSPF Version 2                November 1992
  5155.  
  5156.  
  5157.     that there may be multiple routing table entries for the same desti-
  5158.     nation, depending on the values of the next two fields.
  5159.  
  5160.  
  5161.     Type of Service
  5162.         There can be a separate set of routes for each IP Type  of  Ser-
  5163.         vice.   The encoding of TOS in OSPF link state advertisements is
  5164.         described in Section 12.3.
  5165.  
  5166.     Area
  5167.         This field indicates the area whose link state  information  has
  5168.         led  to  the routing table entry's collection of paths.  This is
  5169.         called the entry's associated area.  For  sets  of  AS  external
  5170.         paths,  this  field  is  not  defined.  For destinations of type
  5171.         "area border router", there may be separate sets of  paths  (and
  5172.         therefore  separate  routing table entries) associated with each
  5173.         of several areas.  This will happen when two area border routers
  5174.         share  multiple  areas  in  common.   For  all other destination
  5175.         types, only the set of paths associated with the best area  (the
  5176.         one providing the shortest route) is kept.
  5177.  
  5178.  
  5179.     The rest of the routing table entry describes the set  of  paths  to
  5180.     the  destination.   The following fields pertain to the set of paths
  5181.     as a whole.  In other words, each one of the paths  contained  in  a
  5182.     routing table entry is of the same path-type and cost (see below).
  5183.  
  5184.  
  5185.     Path-type
  5186.         There are four possible types of paths used to route traffic  to
  5187.         the destination, listed here in order of preference: intra-area,
  5188.         inter-area, type 1 external  or  type  2  external.   Intra-area
  5189.         paths  indicate  destinations  belonging  to one of the router's
  5190.         attached areas.  Inter-area paths are paths to  destinations  in
  5191.         other  OSPF areas.  These are discovered through the examination
  5192.         of received summary link advertisements.  AS external paths  are
  5193.         paths  to  destinations  external to the AS.  These are detected
  5194.         through the examination of received AS external link  advertise-
  5195.         ments.
  5196.  
  5197.     Cost
  5198.         The link state cost of the path to  the  destination.   For  all
  5199.         paths  except  type  2  external paths this describes the entire
  5200.         path's cost.  For Type 2 external paths,  this  field  describes
  5201.         the  cost  of  the portion of the path internal to the AS.  This
  5202.         cost is calculated as the sum of the costs of the path's consti-
  5203.         tuent links.
  5204.  
  5205.  
  5206.  
  5207.  
  5208. [Moy]                                                          [Page 93]
  5209.  
  5210. Internet Draft               OSPF Version 2                November 1992
  5211.  
  5212.  
  5213.     Type 2 cost
  5214.         Only valid for type 2 external paths.   For  these  paths,  this
  5215.         field  indicates  the cost of the path's external portion.  This
  5216.         cost has been advertised by an AS boundary router,  and  is  the
  5217.         most  significant  part  of the total path cost.  For example, a
  5218.         type 2 external path with type 2 cost of 5 is  always  preferred
  5219.         over  a  path  with type 2 cost of 10, regardless of the cost of
  5220.         the two paths' internal components.
  5221.  
  5222.     Link State Origin
  5223.         Valid only for intra-area paths, this field indicates  the  link
  5224.         state   advertisement  (router  links  or  network  links)  that
  5225.         directly references the destination.  For example, if the desti-
  5226.         nation  is a transit network, this is the transit network's net-
  5227.         work links advertisement.  If the destination is a stub network,
  5228.         this  is the router links advertisement for the attached router.
  5229.         The advertisement is discovered during  the  shortest-path  tree
  5230.         calculation  (see  Section  16.1).   Multiple advertisements may
  5231.         reference the destination, however a tie-breaking scheme  always
  5232.         reduces  the  choice  to  a single advertisement. The Link State
  5233.         Origin field is not used by the OSPF protocol, but it is used by
  5234.         the routing table calculation in OSPF's Multicast routing exten-
  5235.         sions (see [MOSPF]).
  5236.  
  5237.     When multiple paths of equal path-type and cost exist to a  destina-
  5238.     tion  (called  elsewhere  "equal-cost"  paths), they are stored in a
  5239.     single routing table entry.  Each one of the "equal-cost"  paths  is
  5240.     distinguished by the following fields:
  5241.  
  5242.  
  5243.     Next hop
  5244.         The outgoing router interface to use when forwarding traffic  to
  5245.         the  destination.   On  multi-access networks, the next hop also
  5246.         includes the IP address of the next router (if any) in the  path
  5247.         towards the destination.  This next router will always be one of
  5248.         the adjacent neighbors.
  5249.  
  5250.     Advertising router
  5251.         Valid only for inter-area and AS  external  paths.   This  field
  5252.         indicates  the  Router  ID of the router advertising the summary
  5253.         link or AS external link that led to this path.
  5254.  
  5255.  
  5256.     11.1.  Routing table lookup
  5257.  
  5258.         When an IP data packet is received, an  OSPF  router  finds  the
  5259.         routing  table entry that best matches the packet's destination.
  5260.         This routing table entry then provides  the  outgoing  interface
  5261.  
  5262.  
  5263.  
  5264. [Moy]                                                          [Page 94]
  5265.  
  5266. Internet Draft               OSPF Version 2                November 1992
  5267.  
  5268.  
  5269.         and  next  hop router to use in forwarding the packet. This sec-
  5270.         tion describes the process of finding the best matching  routing
  5271.         table  entry. The process consists of a number of steps, wherein
  5272.         the collection of routing table entries is progressively pruned.
  5273.         In  the  end,  the  single  routing table entry remaining is the
  5274.         called best match.
  5275.  
  5276.         Note that the steps described below may fail to produce  a  best
  5277.         match  routing  table  entry  (i.e.,  all existing routing table
  5278.         entries are pruned for some reason or another).  In  this  case,
  5279.         the  packet's  IP destination is considered unreachable. Instead
  5280.         of being forwarded, the packet should be  dropped  and  an  ICMP
  5281.         destination  unreachable  message  should  be  returned  to  the
  5282.         packet's source.
  5283.  
  5284.  
  5285.         (1) Select the complete set of "matching" routing table  entries
  5286.             from  the routing table.  Each routing table entry describes
  5287.             a (set of) path(s) to a range of IP addresses. If  the  data
  5288.             packet's  IP  destination  falls into an entry's range of IP
  5289.             addresses, the routing table entry is called a match. (It is
  5290.             quite  likely  that  multiple  entries  will  match the data
  5291.             packet.  For example, a default route will match  all  pack-
  5292.             ets.)
  5293.  
  5294.         (2) Suppose that the packet's IP destination falls into  one  of
  5295.             the  router's  configured  area  address ranges (see Section
  5296.             3.5), and that the particular area address range is  active.
  5297.             This  means  that there are one or more reachable (by intra-
  5298.             area paths) networks contained in the  area  address  range.
  5299.             The  packet's  IP  destination is then required to belong to
  5300.             one of these constituent networks.  For  this  reason,  only
  5301.             matching  routing table entries with path-type of intra-area
  5302.             are considered (all others are pruned). If no such  matching
  5303.             entries  exist,  the destination is unreachable (see above).
  5304.             Otherwise, skip to step 4.
  5305.  
  5306.         (3) Reduce the set of matching entries to those having the  most
  5307.             preferential  path-type  (see  Section  11). OSPF has a four
  5308.             level hierarchy of paths. Intra-area paths are the most pre-
  5309.             ferred, followed in order by inter-area, Type 1 external and
  5310.             Type 2 external paths.
  5311.  
  5312.         (4) Select the remaining routing table entry that  provides  the
  5313.             longest (most specific) match. Another way of saying this is
  5314.             to choose the remaining entry that specifies  the  narrowest
  5315.             range  of  IP  addresses.[10] For example, the entry for the
  5316.             address/mask  pair  of  (128.185.1.0,  0xffffff00)  is  more
  5317.  
  5318.  
  5319.  
  5320. [Moy]                                                          [Page 95]
  5321.  
  5322. Internet Draft               OSPF Version 2                November 1992
  5323.  
  5324.  
  5325.             specific   than   an   entry   for  the  pair  (128.185.0.0,
  5326.             0xffff0000). The default route is the least specific  match,
  5327.             since it matches all destinations.
  5328.  
  5329.         (5) At this point, there may still  be  multiple  routing  table
  5330.             entries  remaining. Each routing entry will specify the same
  5331.             range of IP addresses, but a different IP Type  of  Service.
  5332.             Select  the  routing table entry whose TOS value matches the
  5333.             TOS found in the packet header. If there is no routing table
  5334.             entry  for  this TOS, select the routing table entry for TOS
  5335.             0. In other words, packets requesting TOS X are routed along
  5336.             the TOS 0 path if a TOS X path does not exist.
  5337.  
  5338.  
  5339.     11.2.  Sample routing table, without areas
  5340.  
  5341.         Consider the Autonomous System pictured in Figure  2.   No  OSPF
  5342.         areas  have  been configured.  A single metric is shown per out-
  5343.         bound interface, indicating that routes will not vary  based  on
  5344.         TOS.   The  calculation  router  RT6's routing table proceeds as
  5345.         described in Section 2.1.  The resulting routing table is  shown
  5346.         in Table 12.  Destination types are abbreviated: Network as "N",
  5347.         area border router as "BR" and AS boundary router as "ASBR".
  5348.  
  5349.         There are no instances of multiple equal-cost shortest paths  in
  5350.         this  example.   Also,  since  there  are no areas, there are no
  5351.         inter-area paths.
  5352.  
  5353.         Routers RT5 and RT7 are AS boundary routers.  Intra-area  routes
  5354.         have been calculated to routers RT5 and RT7.  This allows exter-
  5355.         nal routes to be calculated to the  destinations  advertised  by
  5356.         RT5  and  RT7  (i.e.,  networks  N12,  N13, N14 and N15).  It is
  5357.         assumed all AS external advertisements originated by RT5 and RT7
  5358.         are advertising type 1 external metrics.  This results in type 1
  5359.         external paths being calculated to destinations N12-N15.
  5360.  
  5361.  
  5362.  
  5363.     11.3.  Sample routing table, with areas
  5364.  
  5365.         Consider the previous example, this time split into OSPF  areas.
  5366.         An  OSPF  area  configuration  is  pictured in Figure 6.  Router
  5367.         RT4's routing table will be described for this  area  configura-
  5368.         tion.  Router RT4 has a connection to Area 1 and a backbone con-
  5369.         nection.  This causes Router RT4 to view the AS as the  concate-
  5370.         nation  of the two graphs shown in Figures 7 and 8.  The result-
  5371.         ing routing table is displayed in Table 13.
  5372.  
  5373.  
  5374.  
  5375.  
  5376. [Moy]                                                          [Page 96]
  5377.  
  5378. Internet Draft               OSPF Version 2                November 1992
  5379.  
  5380.  
  5381.  
  5382.  
  5383.       Type   Dest   Area   Path  Type    Cost   Next     Adv.
  5384.                                                 Hop(s)   Router(s)
  5385.       ____________________________________________________________
  5386.       N      N1     0      intra-area    10     RT3      *
  5387.       N      N2     0      intra-area    10     RT3      *
  5388.       N      N3     0      intra-area    7      RT3      *
  5389.       N      N4     0      intra-area    8      RT3      *
  5390.       N      Ib     0      intra-area    7      *        *
  5391.       N      Ia     0      intra-area    12     RT10     *
  5392.       N      N6     0      intra-area    8      RT10     *
  5393.       N      N7     0      intra-area    12     RT10     *
  5394.       N      N8     0      intra-area    10     RT10     *
  5395.       N      N9     0      intra-area    11     RT10     *
  5396.       N      N10    0      intra-area    13     RT10     *
  5397.       N      N11    0      intra-area    14     RT10     *
  5398.       N      H1     0      intra-area    21     RT10     *
  5399.       ASBR   RT5    0      intra-area    6      RT5      *
  5400.       ASBR   RT7    0      intra-area    8      RT10     *
  5401.       ____________________________________________________________
  5402.       N      N12    *      type 1 ext.   10     RT10     RT7
  5403.       N      N13    *      type 1 ext.   14     RT5      RT5
  5404.       N      N14    *      type 1 ext.   14     RT5      RT5
  5405.       N      N15    *      type 1 ext.   17     RT10     RT7
  5406.  
  5407.  
  5408.                Table 12: The routing table for Router RT6
  5409.                          (no configured areas).
  5410.  
  5411.         Again, routers RT5 and RT7 are  AS  boundary  routers.   Routers
  5412.         RT3, RT4, RT7, RT10 and RT11 are area border routers.  Note that
  5413.         there are two routing entries (in  this  case  having  identical
  5414.         paths)  for router RT7, in its dual capacities as an area border
  5415.         router and an AS boundary router.  Note also that there are  two
  5416.         routing entries for the area border router RT3, since it has two
  5417.         areas in common with RT4 (Area 1 and the backbone).
  5418.  
  5419.         Backbone paths have been calculated to all area  border  routers
  5420.         (BR).   These  are  used when determining the inter-area routes.
  5421.         Note that all of the inter-area routes are associated  with  the
  5422.         backbone;  this  is always the case when the router is itself an
  5423.         area border router.  Routing information is  condensed  at  area
  5424.         boundaries.   In  this  example,  we assume that Area 3 has been
  5425.         defined so that networks N9-N11 and the host route to H1 are all
  5426.         condensed  to a single route when advertised to the backbone (by
  5427.         router RT11).  Note that the cost of this route is  the  minimum
  5428.         of the set of costs to its individual components.
  5429.  
  5430.  
  5431.  
  5432. [Moy]                                                          [Page 97]
  5433.  
  5434. Internet Draft               OSPF Version 2                November 1992
  5435.  
  5436.  
  5437.         There is a virtual link  configured  between  routers  RT10  and
  5438.         RT11.   Without  this  configured  virtual  link,  RT11 would be
  5439.         unable to advertise a route for networks N9-N11 and host H1 into
  5440.         the backbone, and there would not be an entry for these networks
  5441.         in router RT4's routing table.
  5442.  
  5443.         In this example there are two equal-cost paths to  network  N12.
  5444.         However, they both use the same next hop (Router RT5).
  5445.  
  5446.  
  5447.  
  5448.         Router RT4's routing table would  improve  (i.e.,  some  of  the
  5449.         paths   in  the  routing  table  would  become  shorter)  if  an
  5450.  
  5451.  
  5452.    Type   Dest        Area   Path  Type    Cost   Next      Adv.
  5453.                                                   Hops(s)   Router(s)
  5454.    __________________________________________________________________
  5455.    N      N1          1      intra-area    4      RT1       *
  5456.    N      N2          1      intra-area    4      RT2       *
  5457.    N      N3          1      intra-area    1      *         *
  5458.    N      N4          1      intra-area    3      RT3       *
  5459.    BR     RT3         1      intra-area    1      *         *
  5460.    __________________________________________________________________
  5461.    N      Ib          0      intra-area    22     RT5       *
  5462.    N      Ia          0      intra-area    27     RT5       *
  5463.    BR     RT3         0      intra-area    21     RT5       *
  5464.    BR     RT7         0      intra-area    14     RT5       *
  5465.    BR     RT10        0      intra-area    22     RT5       *
  5466.    BR     RT11        0      intra-area    25     RT5       *
  5467.    ASBR   RT5         0      intra-area    8      *         *
  5468.    ASBR   RT7         0      intra-area    14     RT5       *
  5469.    __________________________________________________________________
  5470.    N      N6          0      inter-area    15     RT5       RT7
  5471.    N      N7          0      inter-area    19     RT5       RT7
  5472.    N      N8          0      inter-area    18     RT5       RT7
  5473.    N      N9-N11,H1   0      inter-area    26     RT5       RT11
  5474.    __________________________________________________________________
  5475.    N      N12         *      type 1 ext.   16     RT5       RT5,RT7
  5476.    N      N13         *      type 1 ext.   16     RT5       RT5
  5477.    N      N14         *      type 1 ext.   16     RT5       RT5
  5478.    N      N15         *      type 1 ext.   23     RT5       RT7
  5479.  
  5480.  
  5481.                   Table 13: Router RT4's routing table
  5482.                        in the presence of areas.
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488. [Moy]                                                          [Page 98]
  5489.  
  5490. Internet Draft               OSPF Version 2                November 1992
  5491.  
  5492.  
  5493.         additional virtual link were configured between router  RT4  and
  5494.         router  RT3.   The  new  virtual link would itself be associated
  5495.         with the first entry for area border router RT3 in Table 13  (an
  5496.         intra-area  path  through Area 1).  This would yield a cost of 1
  5497.         for the virtual link.  The routing table  entries  changes  that
  5498.         would  be  caused by the addition of this virtual link are shown
  5499.         in Table 14.
  5500.  
  5501.  
  5502.  
  5503. 12.  Link State Advertisements
  5504.  
  5505.     Each router in the Autonomous System originates  one  or  more  link
  5506.     state  advertisements.   There are five distinct types of link state
  5507.     advertisements, which are described in Section 4.3.  The  collection
  5508.     of  link  state  advertisements  forms the link state or topological
  5509.     database.  Each separate type of advertisement has a separate  func-
  5510.     tion.  Router links and network links advertisements describe how an
  5511.     area's routers and networks are interconnected.  Summary link adver-
  5512.     tisements provide a way of condensing an area's routing information.
  5513.     AS external advertisements provide a way of transparently  advertis-
  5514.     ing externally-derived routing information throughout the Autonomous
  5515.     System.
  5516.  
  5517.     Each link state advertisement begins with a standard 20-byte header.
  5518.     This link state header is discussed below.
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.     Type   Dest        Area   Path  Type   Cost   Next     Adv.
  5526.                                                   Hop(s)   Router(s)
  5527.     ________________________________________________________________
  5528.     N      Ib          0      intra-area   16     RT3      *
  5529.     N      Ia          0      intra-area   21     RT3      *
  5530.     BR     RT3         0      intra-area   1      *        *
  5531.     BR     RT10        0      intra-area   16     RT3      *
  5532.     BR     RT11        0      intra-area   19     RT3      *
  5533.     ________________________________________________________________
  5534.     N      N9-N11,H1   0      inter-area   20     RT3      RT11
  5535.  
  5536.  
  5537.                   Table 14: Changes resulting from an
  5538.                         additional virtual link.
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544. [Moy]                                                          [Page 99]
  5545.  
  5546. Internet Draft               OSPF Version 2                November 1992
  5547.  
  5548.  
  5549.     12.1.  The Link State Header
  5550.  
  5551.         The link state header contains the LS type, Link  State  ID  and
  5552.         Advertising  Router  fields.   The  combination  of  these three
  5553.         fields uniquely identifies the link state advertisement.
  5554.  
  5555.         There may be several instances of an  advertisement  present  in
  5556.         the  Autonomous  System,  all at the same time.  It must then be
  5557.         determined which instance is more recent.  This determination is
  5558.         made  be  examining  the  LS  sequence,  LS  checksum and LS age
  5559.         fields.  These fields are also contained  in  the  20-byte  link
  5560.         state header.
  5561.  
  5562.         Several of the OSPF packet types list link state advertisements.
  5563.         When the instance is not important, an advertisement is referred
  5564.         to by its LS type, Link State ID  and  Advertising  Router  (see
  5565.         Link State Request Packets).  Otherwise, the LS sequence number,
  5566.         LS age and LS checksum fields must also be referenced.
  5567.  
  5568.         A detailed explanation of the fields contained in the link state
  5569.         header follows.
  5570.  
  5571.  
  5572.         12.1.1.  LS age
  5573.  
  5574.             This field is the age of the  link  state  advertisement  in
  5575.             seconds.   It  should  be  processed  as  an unsigned 16-bit
  5576.             integer.  It is set to 0 when the link  state  advertisement
  5577.             is  originated.   It must be incremented by InfTransDelay on
  5578.             every hop of the flooding procedure.  Link state  advertise-
  5579.             ments  are also aged as they are held in each router's data-
  5580.             base.
  5581.  
  5582.             The age of a link state advertisement is  never  incremented
  5583.             past  MaxAge.  Advertisements having age MaxAge are not used
  5584.             in the routing table calculation.  When  an  advertisement's
  5585.             age  first  reaches  MaxAge,  it is reflooded.  A link state
  5586.             advertisement of age MaxAge  is  finally  flushed  from  the
  5587.             database when it is no longer contained on any neighbor Link
  5588.             state retransmission lists.  This indicates that it has been
  5589.             acknowledged  by  all adjacent neighbors.  For more informa-
  5590.             tion on the aging of link state advertisements, consult Sec-
  5591.             tion 14.
  5592.  
  5593.             Ages are examined when a router receives two instances of  a
  5594.             link  state  advertisement,  both  having identical sequence
  5595.             numbers and checksums.  An instance of age  MaxAge  is  then
  5596.             always   accepted   as   most   recent;   this   allows  old
  5597.  
  5598.  
  5599.  
  5600. [Moy]                                                         [Page 100]
  5601.  
  5602. Internet Draft               OSPF Version 2                November 1992
  5603.  
  5604.  
  5605.             advertisements  to  be  flushed  quickly  from  the  routing
  5606.             domain.   Otherwise,  if  the  ages differ by more than Max-
  5607.             AgeDiff, the instance having the smaller age is accepted  as
  5608.             most recent.[11] See Section 13.1 for more details.
  5609.  
  5610.  
  5611.         12.1.2.  Options
  5612.  
  5613.             The options field in the link state header  indicates  which
  5614.             optional capabilities are associated with the advertisement.
  5615.             OSPF's optional capabilities are described in  Section  4.5.
  5616.             There  are currently two optional capabilities defined; they
  5617.             are represented by the T-bit and E-bit found in the  options
  5618.             field.  The rest of the options field should be set to zero.
  5619.  
  5620.             The E-bit represents  OSPF's  external  routing  capability.
  5621.             This bit should be set in all advertisements associated with
  5622.             the backbone, and all advertisements  associated  with  non-
  5623.             stub  areas (see Section 3.6).  It should also be set in all
  5624.             AS external advertisements.   It  should  be  reset  in  all
  5625.             router  links, network links and summary link advertisements
  5626.             associated with a stub area.  For all link state  advertise-
  5627.             ments,  the  setting  of the E-bit is for informational pur-
  5628.             poses only; it does not affect the  routing  table  calcula-
  5629.             tion.
  5630.  
  5631.             The T-bit represents OSPF's TOS  routing  capability.   This
  5632.             bit  should  be  set  in a router links advertisement if and
  5633.             only if the router is capable of calculating separate routes
  5634.             for  each IP TOS (see Section 2.4).  The T-bit should always
  5635.             be set in network links advertisements.  It should be set in
  5636.             summary link and AS external link advertisements if and only
  5637.             if the advertisement describes paths  for  all  TOS  values,
  5638.             instead  of  just the TOS 0 path.  Note that, with the T-bit
  5639.             set, there may still be only a single metric in  the  adver-
  5640.             tisement (the TOS 0 metric).  This would mean that paths for
  5641.             non-zero TOS exist, but are equivalent to the TOS 0 path.  A
  5642.             link  state advertisement's T-bit is examined when calculat-
  5643.             ing the routing table's  non-zero  TOS  paths  (see  Section
  5644.             16.9).
  5645.  
  5646.  
  5647.         12.1.3.  LS type
  5648.  
  5649.             The LS type field dictates the format and  function  of  the
  5650.             link state advertisement.  Advertisements of different types
  5651.             have different names (e.g., router links or network  links).
  5652.             All   advertisement  types,  except  the  AS  external  link
  5653.  
  5654.  
  5655.  
  5656. [Moy]                                                         [Page 101]
  5657.  
  5658. Internet Draft               OSPF Version 2                November 1992
  5659.  
  5660.  
  5661.             advertisements (LS type = 5), are flooded throughout a  sin-
  5662.             gle  area only.  AS external link advertisements are flooded
  5663.             throughout the  entire  Autonomous  System,  excluding  stub
  5664.             areas  (see  Section 3.6).  Each separate advertisement type
  5665.             is briefly described below in Table 15.
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.            LS Type   Advertisement description
  5673.            __________________________________________________
  5674.            1         These are the router links
  5675.                      advertisements. They describe the
  5676.                      collected states of the router's
  5677.                      interfaces. For more information,
  5678.                      consult Section 12.4.1.
  5679.            __________________________________________________
  5680.            2         These are the network links
  5681.                      advertisements. They describe the set
  5682.                      of routers attached to the network. For
  5683.                      more information, consult
  5684.                      Section 12.4.2.
  5685.            __________________________________________________
  5686.            3 or 4    These are the summary link
  5687.                      advertisements. They describe
  5688.                      inter-area routes, and enable the
  5689.                      condensation of routing information at
  5690.                      area borders. Originated by area border
  5691.                      routers, the Type 3 advertisements
  5692.                      describe routes to networks while the
  5693.                      Type 4 advertisements describe routes to
  5694.                      AS boundary routers.
  5695.            __________________________________________________
  5696.            5         These are the AS external link
  5697.                      advertisements. Originated by AS
  5698.                      boundary routers, they describe routes
  5699.                      to destinations external to the
  5700.                      Autonomous System. A default route for
  5701.                      the Autonomous System can also be
  5702.                      described by an AS external link
  5703.                      advertisement.
  5704.  
  5705.  
  5706.                Table 15: OSPF link state advertisements.
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712. [Moy]                                                         [Page 102]
  5713.  
  5714. Internet Draft               OSPF Version 2                November 1992
  5715.  
  5716.  
  5717.         12.1.4.  Link State ID
  5718.  
  5719.             This field identifies the piece of the routing  domain  that
  5720.             is  being  described by the advertisement.  Depending on the
  5721.             advertisement's LS type, the Link  State  ID  takes  on  the
  5722.             values listed in Table 16.
  5723.  
  5724.  
  5725.             Actually, for summary link (LS type = 3) advertisements  and
  5726.             AS  external  link  (LS  type  = 5) advertisements, the Link
  5727.             State ID may additionally have one or more of  the  destina-
  5728.             tion  network's "host" bits set. For example, when originat-
  5729.             ing an AS external link for the network 10.0.0.0  with  mask
  5730.             of  255.0.0.0,  the  Link State ID can be set to anything in
  5731.             the  range   10.0.0.0   through   10.255.255.255   inclusive
  5732.             (although  10.0.0.0  should  be used whenever possible). The
  5733.             freedom to set certain host bits allows  a  router  to  ori-
  5734.             ginate  separate  advertisements for two networks having the
  5735.             same  address  but  different  masks.  See  Appendix  F  for
  5736.             details.
  5737.  
  5738.             When the link state advertisement is  describing  a  network
  5739.             (LS  type  =  2, 3 or 5), the network's IP address is easily
  5740.             derived by masking the Link State ID with the network/subnet
  5741.             mask  contained in the body of the link state advertisement.
  5742.             When the link state advertisement is describing a router (LS
  5743.             type  =  1  or 4), the Link State ID is always the described
  5744.             router's OSPF Router ID.
  5745.  
  5746.             When an AS external advertisement (LS Type = 5) is  describ-
  5747.             ing a default route, its Link State ID is set to DefaultDes-
  5748.             tination (0.0.0.0).
  5749.  
  5750.  
  5751.             LS Type   Link State ID
  5752.             _______________________________________________
  5753.             1         The originating router's Router ID.
  5754.             2         The IP interface address of the
  5755.                       network's Designated Router.
  5756.             3         The destination network's IP address.
  5757.             4         The Router ID of the described AS
  5758.                       boundary router.
  5759.             5         The destination network's IP address.
  5760.  
  5761.  
  5762.               Table 16: The advertisement's Link State ID.
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768. [Moy]                                                         [Page 103]
  5769.  
  5770. Internet Draft               OSPF Version 2                November 1992
  5771.  
  5772.  
  5773.         12.1.5.  Advertising Router
  5774.  
  5775.             This  field  specifies   the   OSPF   Router   ID   of   the
  5776.             advertisement's  originator.   For  router  links advertise-
  5777.             ments, this field is identical to the Link State  ID  field.
  5778.             Network  link advertisements are originated by the network's
  5779.             Designated Router.  Summary  link  advertisements  are  ori-
  5780.             ginated by area border routers.  AS external link advertise-
  5781.             ments are originated by AS boundary routers.
  5782.  
  5783.  
  5784.         12.1.6.  LS sequence number
  5785.  
  5786.             The sequence number field is a signed 32-bit integer.  It is
  5787.             used  to detect old and duplicate link state advertisements.
  5788.             The space of sequence  numbers  is  linearly  ordered.   The
  5789.             larger  the  sequence number (when compared as signed 32-bit
  5790.             integers) the more recent the advertisement.  To describe to
  5791.             sequence  number  space  more  precisely, let N refer in the
  5792.             discussion below to the constant 2**31.
  5793.  
  5794.             The  sequence  number  -N  (0x80000000)  is  reserved   (and
  5795.             unused).   This  leaves  -N + 1 (0x80000001) as the smallest
  5796.             (and therefore oldest) sequence number.  A router uses  this
  5797.             sequence  number the first time it originates any link state
  5798.             advertisement.   Afterwards,  the  advertisement's  sequence
  5799.             number  is incremented each time the router originates a new
  5800.             instance of the advertisement.  When an attempt is  made  to
  5801.             increment the sequence number past the maximum value of of N
  5802.             - 1 (0x7fffffff), the current instance of the  advertisement
  5803.             must first be flushed from the routing domain.  This is done
  5804.             by prematurely aging the advertisement  (see  Section  14.1)
  5805.             and  reflooding  it.   As  soon  as this flood has been ack-
  5806.             nowledged by all adjacent neighbors, a new instance  can  be
  5807.             originated with sequence number of -N + 1 (0x80000001).
  5808.  
  5809.             The router may be forced to promote the sequence  number  of
  5810.             one of its advertisements when a more recent instance of the
  5811.             advertisement is unexpectedly received during  the  flooding
  5812.             process.   This  should  be a rare event.  This may indicate
  5813.             that an out-of-date advertisement, originated by the  router
  5814.             itself  before  its last restart/reload, still exists in the
  5815.             Autonomous System.  For more information see Section 13.4.
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824. [Moy]                                                         [Page 104]
  5825.  
  5826. Internet Draft               OSPF Version 2                November 1992
  5827.  
  5828.  
  5829.         12.1.7.  LS checksum
  5830.  
  5831.             This field is the checksum of the complete contents  of  the
  5832.             advertisement,  excepting  the  age field.  The age field is
  5833.             excepted so that an advertisement's age can  be  incremented
  5834.             without  updating  the  checksum.   The checksum used is the
  5835.             same that is used for ISO connectionless  datagrams;  it  is
  5836.             commonly  referred to as the Fletcher checksum.  It is docu-
  5837.             mented in Annex B of [RFC 905].  The link state header  also
  5838.             contains the length of the advertisement in bytes; subtract-
  5839.             ing the size of the age field (two bytes) yields the  amount
  5840.             of data to checksum.
  5841.  
  5842.             The checksum is used to detect data corruption of an  adver-
  5843.             tisement.   This corruption can occur while an advertisement
  5844.             is being flooded, or while it is being held  in  a  router's
  5845.             memory.   The  LS checksum field cannot take on the value of
  5846.             zero; the occurrence of such a value should be considered  a
  5847.             checksum failure.  In other words, calculation of the check-
  5848.             sum is not optional.
  5849.  
  5850.             The checksum of a link state advertisement  is  verified  in
  5851.             two  cases:  a)  when  it is received in a Link State Update
  5852.             Packet and b) at times during the aging of  the  link  state
  5853.             database.   The  detection  of  a  checksum failure leads to
  5854.             separate actions in each case.  See Sections 13 and  14  for
  5855.             more details.
  5856.  
  5857.             Whenever the LS sequence number  field  indicates  that  two
  5858.             instances  of an advertisement are the same, the LS checksum
  5859.             field is examined.  If there is a difference,  the  instance
  5860.             with   the   larger   checksum  is  considered  to  be  most
  5861.             recent.[12] See Section 13.1 for more details.
  5862.  
  5863.  
  5864.     12.2.  The link state database
  5865.  
  5866.         A router has a separate link state database for  every  area  to
  5867.         which  it belongs.  The link state database has been referred to
  5868.         elsewhere in the text as the topological database.  All  routers
  5869.         belonging  to the same area have identical topological databases
  5870.         for the area.
  5871.  
  5872.         The databases for each individual area  are  always  dealt  with
  5873.         separately.    The   shortest   path  calculation  is  performed
  5874.         separately for each area (see Section 16).   Components  of  the
  5875.         area  topological database are flooded throughout the area only.
  5876.         Finally, when an  adjacency  (belonging  to  Area  A)  is  being
  5877.  
  5878.  
  5879.  
  5880. [Moy]                                                         [Page 105]
  5881.  
  5882. Internet Draft               OSPF Version 2                November 1992
  5883.  
  5884.  
  5885.         brought up, only the database for Area A is synchronized between
  5886.         the two routers.
  5887.  
  5888.         The area database is composed of  router  links  advertisements,
  5889.         network  links  advertisements,  and summary link advertisements
  5890.         (all listed in the area data structure).  In addition,  external
  5891.         routes (AS external advertisements) are included in all non-stub
  5892.         area databases (see Section 3.6).
  5893.  
  5894.         An implementation of OSPF must  be  able  to  access  individual
  5895.         pieces of an area database.  This lookup function is based on an
  5896.         advertisement's  LS  type,  Link  State   ID   and   Advertising
  5897.         Router.[13]  There  will  be  a single instance (the most up-to-
  5898.         date) of each link state advertisement  in  the  database.   The
  5899.         database lookup function is invoked during the link state flood-
  5900.         ing procedure (Section 13) and  the  routing  table  calculation
  5901.         (Section  16).   In  addition,  using  this  lookup function the
  5902.         router can determine whether it has  itself  ever  originated  a
  5903.         particular  link  state  advertisement,  and if so, with what LS
  5904.         sequence number.
  5905.  
  5906.         A link state advertisement is added to a router's database  when
  5907.         either  a)  it  is received during the flooding process (Section
  5908.         13) or b) it is originated by the router itself (Section  12.4).
  5909.         A  link  state advertisement is deleted from a router's database
  5910.         when either a) it has been overwritten by a newer instance  dur-
  5911.         ing  the  flooding  process  (Section  13) or b) the router ori-
  5912.         ginates a newer instance of one of  its  self-originated  adver-
  5913.         tisements (Section 12.4) or c) the advertisement ages out and is
  5914.         flushed from the routing domain (Section 14).  Whenever  a  link
  5915.         state advertisement is deleted from the database it must also be
  5916.         removed from all neighbors' Link state retransmission lists (see
  5917.         Section 10).
  5918.  
  5919.  
  5920.     12.3.  Representation of TOS
  5921.  
  5922.         All OSPF link state advertisements (with the exception  of  net-
  5923.         work  links  advertisements)  specify  metrics.  In router links
  5924.         advertisements, the metrics indicate the costs of the  described
  5925.         interfaces.   In  summary  link  and AS external link advertise-
  5926.         ments, the metric indicates the cost of the described path.   In
  5927.         all  of these advertisements, a separate metric can be specified
  5928.         for each IP TOS.  The encoding of TOS in OSPF link state  adver-
  5929.         tisements  is specified in Table 17. That table relates the OSPF
  5930.         encoding to the IP packet header's TOS field  (defined  in  [RFC
  5931.         1349]).   The  OSPF  encoding is expressed as a decimal integer,
  5932.         and the IP packet header's TOS field is expressed in the  binary
  5933.  
  5934.  
  5935.  
  5936. [Moy]                                                         [Page 106]
  5937.  
  5938. Internet Draft               OSPF Version 2                November 1992
  5939.  
  5940.  
  5941.         TOS values used in [RFC 1349].
  5942.  
  5943.  
  5944.  
  5945.                     OSPF encoding   RFC 1349 TOS values
  5946.                     ___________________________________________
  5947.                     0               0000 normal service
  5948.                     2               0001 minimize monetary cost
  5949.                     4               0010 maximize reliability
  5950.                     6               0011
  5951.                     8               0100 maximize throughput
  5952.                     10              0101
  5953.                     12              0110
  5954.                     14              0111
  5955.                     16              1000 minimize delay
  5956.                     18              1001
  5957.                     20              1010
  5958.                     22              1011
  5959.                     24              1100
  5960.                     26              1101
  5961.                     28              1110
  5962.                     30              1111
  5963.  
  5964.  
  5965.                         Table 17: Representing TOS in OSPF.
  5966.  
  5967.  
  5968.         Each OSPF link  state  advertisement  must  specify  the  TOS  0
  5969.         metric.  Other TOS metrics, if they appear, must appear in order
  5970.         of increasing TOS encoding.  For example, the  TOS  8  (maximize
  5971.         throughput)  metric must always appear before the TOS 16 (minim-
  5972.         ize delay) metric when both are specified.  If a metric for some
  5973.         non-zero TOS is not specified, its cost defaults to the cost for
  5974.         TOS 0, unless the T-bit is reset in the advertisement's  options
  5975.         field (see Section 12.1.2 for more details).
  5976.  
  5977.  
  5978.     12.4.  Originating link state advertisements
  5979.  
  5980.         A router may originate many types of link state  advertisements.
  5981.         A  router  originates a router links advertisement for each area
  5982.         to which it belongs.  If  the  router  is  also  the  Designated
  5983.         Router  for  any  of  its attached networks, it will originate a
  5984.         network links advertisement for that network.
  5985.  
  5986.         Area border routers originate a single summary links  advertise-
  5987.         ment for each known inter-area destination.  AS boundary routers
  5988.         originate a single AS  external  links  advertisement  for  each
  5989.  
  5990.  
  5991.  
  5992. [Moy]                                                         [Page 107]
  5993.  
  5994. Internet Draft               OSPF Version 2                November 1992
  5995.  
  5996.  
  5997.         known  AS external destination.  Destinations are advertised one
  5998.         at a time so that the change in any single route can be  flooded
  5999.         without  reflooding the entire collection of routes.  During the
  6000.         flooding procedure, many link state advertisements can  be  car-
  6001.         ried by a single Link State Update packet.
  6002.  
  6003.         As an example, consider router RT4 in Figure 6.  It is  an  area
  6004.         border  router,  having a connection to Area 1 and the backbone.
  6005.         Router RT4 originates 5 distinct link state advertisements  into
  6006.         the backbone (one router links, and one summary link for each of
  6007.         the networks N1-N4).  Router RT4 will also originate 8  distinct
  6008.         link  state  advertisements  into  Area  1 (one router links and
  6009.         seven summary link advertisements as pictured in Figure 7).   If
  6010.         RT4  has  been  selected as Designated Router for network N3, it
  6011.         will also originate a network links advertisement  for  N3  into
  6012.         Area 1.
  6013.  
  6014.         In this same figure, router RT5 will be originating  3  distinct
  6015.         AS  external  link  advertisements (one for each of the networks
  6016.         N12-N14).  These will  be  flooded  throughout  the  entire  AS,
  6017.         assuming  that  none of the areas have been configured as stubs.
  6018.         However, if area 3 has been  configured  as  a  stub  area,  the
  6019.         external advertisements for networks N12-N14 will not be flooded
  6020.         into area 3 (see Section 3.6).  Instead, router RT11 would  ori-
  6021.         ginate  a  default  summary  link  advertisement  that  would be
  6022.         flooded throughout area 3 (see Section 12.4.3).  This  instructs
  6023.         all  of  area  3's  internal  routers  to send their AS external
  6024.         traffic to RT11.
  6025.  
  6026.         Whenever a new instance of a link state  advertisement  is  ori-
  6027.         ginated,  its  LS  sequence number is incremented, its LS age is
  6028.         set to 0, its LS checksum is calculated, and  the  advertisement
  6029.         is  added  to  the  link  state  database  and  flooded  out the
  6030.         appropriate interfaces.  See Section 13.2 for details concerning
  6031.         the  installation of the advertisement into the link state data-
  6032.         base.  See Section 13.3 for details concerning the  flooding  of
  6033.         newly originated advertisements.
  6034.  
  6035.  
  6036.         The eight events that cause a  new  instance  of  a  link  state
  6037.         advertisement to be originated are:
  6038.  
  6039.  
  6040.         (1) The LS refresh timer firing.  There is a  LS  refresh  timer
  6041.             for  each  link state advertisement that the router has ori-
  6042.             ginated.  The LS refresh timer is an  interval  timer,  with
  6043.             length  LSRefreshTimer.   The  LS  refresh  timer guarantees
  6044.             periodic originations regardless of any  other  events  that
  6045.  
  6046.  
  6047.  
  6048. [Moy]                                                         [Page 108]
  6049.  
  6050. Internet Draft               OSPF Version 2                November 1992
  6051.  
  6052.  
  6053.             cause  new  instances.  This periodic updating of link state
  6054.             advertisements adds robustness to the link state  algorithm.
  6055.             Link  state  advertisements that solely describe unreachable
  6056.             destinations should not be refreshed, but should instead  be
  6057.             flushed from the routing domain (see Section 14.1).
  6058.  
  6059.  
  6060.         When whatever is being described by a link  state  advertisement
  6061.         changes,  a  new  advertisement is originated.  Two instances of
  6062.         the same link state advertisement may not be  originated  within
  6063.         the  time  period MinLSInterval.  This may require that the gen-
  6064.         eration of the next instance to be delayed by up to  MinLSInter-
  6065.         val.   The  following  changes may cause a router to originate a
  6066.         new instance of an advertisement.  These  changes  should  cause
  6067.         new  originations  only if the contents of the new advertisement
  6068.         would be different.
  6069.  
  6070.  
  6071.         (2) An interface's state changes (see Section  9.1).   This  may
  6072.             mean  that  it is necessary to produce a new instance of the
  6073.             router links advertisement.
  6074.  
  6075.         (3) An attached network's  Designated  Router  changes.   A  new
  6076.             router  links  advertisement should be originated.  Also, if
  6077.             the router itself is now the Designated Router, a  new  net-
  6078.             work links advertisement should be produced.
  6079.  
  6080.         (4) One of the neighboring  routers  changes  to/from  the  FULL
  6081.             state.   This may mean that it is necessary to produce a new
  6082.             instance of the router links advertisement.   Also,  if  the
  6083.             router is itself the Designated Router for the attached net-
  6084.             work, a new network links advertisement should be produced.
  6085.  
  6086.  
  6087.         The next three events concern area border routers only.
  6088.  
  6089.  
  6090.         (5) An intra-area route has been added/deleted/modified  in  the
  6091.             routing  table.   This may cause a new instance of a summary
  6092.             links advertisement (for this route)  to  be  originated  in
  6093.             each attached area (this includes the backbone).
  6094.  
  6095.         (6) An inter-area route has been added/deleted/modified  in  the
  6096.             routing  table.   This may cause a new instance of a summary
  6097.             links advertisement (for this route)  to  be  originated  in
  6098.             each attached area (but NEVER for the backbone).
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104. [Moy]                                                         [Page 109]
  6105.  
  6106. Internet Draft               OSPF Version 2                November 1992
  6107.  
  6108.  
  6109.         (7) The router becomes newly attached to an  area.   The  router
  6110.             must  then  originate  summary  link advertisements into the
  6111.             newly attached area for all pertinent intra-area and  inter-
  6112.             area  routes  in  its routing table.  See Section 12.4.3 for
  6113.             more details.
  6114.  
  6115.  
  6116.         The last event concerns AS boundary routers only.
  6117.  
  6118.  
  6119.         (8) An external route gained through direct experience  with  an
  6120.             external  routing  protocol  (like  EGP) changes.  This will
  6121.             cause the AS boundary router to originate a new instance  of
  6122.             an external links advertisement.
  6123.  
  6124.  
  6125.         The construction of each type of the link state advertisement is
  6126.         explained  below.   In general, these sections describe the con-
  6127.         tents of the advertisement body (i.e., the part coming after the
  6128.         20-byte  advertisement  header).  For information concerning the
  6129.         building of the link state  advertisement  header,  see  Section
  6130.         12.1.
  6131.  
  6132.         12.4.1.  Router links
  6133.  
  6134.             A router originates a router links  advertisement  for  each
  6135.             area  that  it  belongs to.  Such an advertisement describes
  6136.             the collected states of the router's links to the area.  The
  6137.             advertisement is flooded throughout the particular area, and
  6138.             no further.
  6139.  
  6140.             The format of a  router  links  advertisement  is  shown  in
  6141.             Appendix  A  (Section  A.4.2).   The  first  20 bytes of the
  6142.             advertisement consist of the generic link state header  that
  6143.             was  discussed in Section 12.1.  Router links advertisements
  6144.             have LS type = 1.  The router indicates whether it  is  wil-
  6145.             ling to calculate separate routes for each IP TOS by setting
  6146.             (or resetting) the T-bit of the link  state  advertisement's
  6147.             Options field.
  6148.  
  6149.             A router also indicates whether it is an area border router,
  6150.             or  an  AS  boundary router, by setting the appropriate bits
  6151.             (bit B and bit E, respectively) in its router  links  adver-
  6152.             tisements.  This  enables paths to those types of routers to
  6153.             be saved in the routing table, for later processing of  sum-
  6154.             mary  link  advertisements  and  AS external link advertise-
  6155.             ments. Note that bit E should never be set in a router links
  6156.             advertisement  for a stub area (stub areas cannot contain AS
  6157.  
  6158.  
  6159.  
  6160. [Moy]                                                         [Page 110]
  6161.  
  6162. Internet Draft               OSPF Version 2                November 1992
  6163.  
  6164.  
  6165.  
  6166.                   ....................................
  6167.                   . 192.1.2                   Area 1 .
  6168.                   .     +                            .
  6169.                   .     |                            .
  6170.                   .     | 3+---+1                    .
  6171.                   .  N1 |--|RT1|-----+               .
  6172.                   .     |  +---+                    .
  6173.                   .     |                _______N3  .
  6174.                   .     +               /          .  1+---+
  6175.                   .                     * 192.1.1 *------|RT4|
  6176.                   .     +               /_______/   .   +---+
  6177.                   .     |              /     |       .
  6178.                   .     | 3+---+1     /      |       .
  6179.                   .  N2 |--|RT2|-----+      1|       .
  6180.                   .     |  +---+           +---+8    .         6+---+
  6181.                   .     |                  |RT3|----------------|RT6|
  6182.                   .     +                  +---+     .          +---+
  6183.                   . 192.1.3                  |2      .   18.10.0.6|7
  6184.                   .                          |       .            |
  6185.                   .                   +------------+ .
  6186.                   .                     192.1.4 (N4) .
  6187.                   ....................................
  6188.  
  6189.  
  6190.                     Figure 15: Area 1 with IP addresses shown
  6191.  
  6192.             boundary routers). In addition, the router sets bit V in its
  6193.             router  links  advertisement for Area A if and only if it is
  6194.             the endpoint of an active virtual link using Area A  as  its
  6195.             transit  area.  This  enables  the other routers attached to
  6196.             Area A to discover whether the  area  supports  any  virtual
  6197.             links (i.e., is a transit area).
  6198.  
  6199.             The router links advertisement then describes  the  router's
  6200.             working connections (links) to the area.  Each link is typed
  6201.             according to the kind of attached  network.   Each  link  is
  6202.             also labelled with its Link ID.  This ID gives a name to the
  6203.             entity that is on the other end of the link.  Table 18  sum-
  6204.             marizes the values used for the type and Link ID fields.
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216. [Moy]                                                         [Page 111]
  6217.  
  6218. Internet Draft               OSPF Version 2                November 1992
  6219.  
  6220.  
  6221.  
  6222.                    Link type   Description       Link ID
  6223.                    __________________________________________________
  6224.                    1           Point-to-point    Neighbor Router ID
  6225.                                link
  6226.                    2           Link to transit   Interface address of
  6227.                                network           Designated Router
  6228.                    3           Link to stub      IP network number
  6229.                                network
  6230.                    4           Virtual link      Neighbor Router ID
  6231.  
  6232.  
  6233.                            Table 18: Link descriptions in the
  6234.                               router links advertisement.
  6235.  
  6236.  
  6237.             In addition, the Link Data field is specified for each link.
  6238.             This  field gives 32 bits of extra information for the link.
  6239.             For links to routers and transit networks, this field speci-
  6240.             fies  the  IP  interface  address  of  the associated router
  6241.             interface (this is needed by the routing table  calculation,
  6242.             see Section 16.1.1).  For links to stub networks, this field
  6243.             specifies the network's IP  address  mask.   For  unnumbered
  6244.             point-to-point  networks,  the Link Data field should be set
  6245.             to the unnumbered  interface's  MIB-II  [RFC  1213]  ifIndex
  6246.             value.
  6247.  
  6248.             Finally, the cost of using the  link  for  output  (possibly
  6249.             specifying  a  different  cost  for each type of service) is
  6250.             specified.  The output cost of a link is  configurable.   It
  6251.             must always be non-zero.
  6252.  
  6253.             To further describe the process of building the list of link
  6254.             descriptions,  suppose  a  router  wishes  to build a router
  6255.             links advertisement for Area A.   The  router  examines  its
  6256.             collection  of  interface  data structures.  For each inter-
  6257.             face, the following steps are taken:
  6258.  
  6259.  
  6260.             o   If the attached network does not belong to  Area  A,  no
  6261.                 links  are  added  to  the  advertisement,  and the next
  6262.                 interface should be examined.
  6263.  
  6264.             o   Else, if the state of the interface is  Down,  no  links
  6265.                 are added.
  6266.  
  6267.             o   Else, if the state of the interface  is  Point-to-Point,
  6268.                 then add links according to the following:
  6269.  
  6270.  
  6271.  
  6272. [Moy]                                                         [Page 112]
  6273.  
  6274. Internet Draft               OSPF Version 2                November 1992
  6275.  
  6276.  
  6277.                 -   If the neighboring router is fully adjacent,  add  a
  6278.                     Type 1 link (point-to-point) if this is an interface
  6279.                     to a point-to-point network, or add a  type  4  link
  6280.                     (virtual  link) if this is a virtual link.  The Link
  6281.                     ID should be set to the Router ID of the neighboring
  6282.                     router.  For  virtual  links  and numbered point-to-
  6283.                     point networks, the Link  Data  should  specify  the
  6284.                     interface  IP address. For unnumbered point-to-point
  6285.                     networks, the Link Data  field  should  specify  the
  6286.                     interface's MIB-II [RFC 1213] ifIndex value.
  6287.  
  6288.                 -   If this is a numbered point-to-point  network  (i.e,
  6289.                     not  a  virtual link and not an unnumbered point-to-
  6290.                     point  network)  and  the  neighboring  router's  IP
  6291.                     address  is  known, add a Type 3 link (stub network)
  6292.                     whose Link ID is the neighbor's  IP  address,  whose
  6293.                     Link  Data  is the mask 0xffffffff indicating a host
  6294.                     route, and whose cost is the interface's  configured
  6295.                     output cost.
  6296.  
  6297.             o   Else if the state of the interface is  Loopback,  add  a
  6298.                 Type  3  link  (stub  network) as long as this is not an
  6299.                 interface to an unnumbered serial  line.   The  Link  ID
  6300.                 should be set to the IP interface address, the Link Data
  6301.                 set to the mask 0xffffffff (indicating  a  host  route),
  6302.                 and the cost set to 0.
  6303.  
  6304.             o   Else if the state of the interface  is  Waiting,  add  a
  6305.                 Type  3 link (stub network) whose Link ID is the IP net-
  6306.                 work number of the attached network and whose Link  Data
  6307.                 is the attached network's address mask.
  6308.  
  6309.             o   Else, there has been a Designated  Router  selected  for
  6310.                 the  attached  network.  If the router is fully adjacent
  6311.                 to the Designated Router, or if  the  router  itself  is
  6312.                 Designated  Router and is fully adjacent to at least one
  6313.                 other router, add a single Type 2 link (transit network)
  6314.                 whose  whose  link ID is the IP interface address of the
  6315.                 attached network's Designated Router (which may  be  the
  6316.                 router  itself)  and whose Link Data is the interface IP
  6317.                 address.  Otherwise, add a  link  as  if  the  interface
  6318.                 state were Waiting (see above).
  6319.  
  6320.  
  6321.             Unless otherwise specified, the cost of each link  generated
  6322.             by  the  above  procedure is equal to the output cost of the
  6323.             associated interface.  Note  that  in  the  case  of  serial
  6324.             lines,   multiple   links  may  be  generated  by  a  single
  6325.  
  6326.  
  6327.  
  6328. [Moy]                                                         [Page 113]
  6329.  
  6330. Internet Draft               OSPF Version 2                November 1992
  6331.  
  6332.  
  6333.             interface.
  6334.  
  6335.             After consideration of all the router interfaces, host links
  6336.             are  added  to  the  advertisement  by examining the list of
  6337.             attached hosts.  A host route is represented  as  a  Type  3
  6338.             link  (stub  network) whose link ID is the host's IP address
  6339.             and whose Link Data is the mask of all ones (0xffffffff).
  6340.  
  6341.             As an example, consider the router links advertisements gen-
  6342.             erated  by  router  RT3,  as pictured in Figure 6.  The area
  6343.             containing router RT3 (Area 1) has been redrawn, with actual
  6344.             network  addresses, in Figure 15.  Assume that the last byte
  6345.             of all of RT3's interface addresses  is  3,  giving  it  the
  6346.             interface  addresses  192.1.1.3  and 192.1.4.3, and that the
  6347.             other routers have similar addressing schemes.  In addition,
  6348.             assume  that  all  links are functional, and that Router IDs
  6349.             are assigned as the smallest IP interface address.
  6350.  
  6351.             RT3 originates two router links advertisements, one for Area
  6352.             1 and one for the backbone.  Assume that router RT4 has been
  6353.             selected as the Designated  router  for  network  192.1.1.0.
  6354.             RT3's  router  links  advertisement for Area 1 is then shown
  6355.             below.  It indicates that RT3 has two connections to Area 1,
  6356.             the  first  a  link to the transit network 192.1.1.0 and the
  6357.             second a link to the stub network 192.1.4.0.  Note that  the
  6358.             transit  network  is  identified  by the IP interface of its
  6359.             Designated Router (i.e., the Link ID =  192.1.1.4  which  is
  6360.             the  Designated  Router  RT4's  IP  interface to 192.1.1.0).
  6361.             Note also that RT3 has indicated that it is capable of  cal-
  6362.             culating  separate  routes  based on IP TOS, through setting
  6363.             the T-bit in the Options field.  It has also indicated  that
  6364.             it is an area border router.
  6365.  
  6366.                    ; RT3's router links advertisement for Area 1
  6367.  
  6368.                    LS age = 0                     ;always true on origination
  6369.                    Options = (T-bit|E-bit)        ;TOS-capable
  6370.                    LS type = 1                    ;indicates router links
  6371.                    Link State ID = 192.1.1.3      ;RT3's Router ID
  6372.                    Advertising Router = 192.1.1.3 ;RT3's Router ID
  6373.                    bit E = 0                      ;not an AS boundary router
  6374.                    bit B = 1                      ;RT3 is an area border router
  6375.                    #links = 2
  6376.                            Link ID = 192.1.1.4    ;IP address of Designated Router
  6377.                            Link Data = 192.1.1.3  ;RT3's IP interface to net
  6378.                            Type = 2               ;connects to transit network
  6379.                            # other metrics = 0
  6380.                            TOS 0 metric = 1
  6381.  
  6382.  
  6383.  
  6384. [Moy]                                                         [Page 114]
  6385.  
  6386. Internet Draft               OSPF Version 2                November 1992
  6387.  
  6388.  
  6389.                            Link ID = 192.1.4.0    ;IP Network number
  6390.                            Link Data = 0xffffff00 ;Network mask
  6391.                            Type = 3               ;connects to stub network
  6392.                            # other metrics = 0
  6393.                            TOS 0 metric = 2
  6394.  
  6395.             Next RT3's router links advertisement for  the  backbone  is
  6396.             shown.  It indicates that RT3 has a single attachment to the
  6397.             backbone.  This attachment is via  an  unnumbered  point-to-
  6398.             point  link  to router RT6.  RT3 has again indicated that it
  6399.             is TOS-capable, and that it is an area border router.
  6400.  
  6401.                    ; RT3's router links advertisement for the backbone
  6402.  
  6403.                    LS age = 0                     ;always true on origination
  6404.                    Options = (T-bit|E-bit)        ;TOS-capable
  6405.                    LS type = 1                    ;indicates router links
  6406.                    Link State ID = 192.1.1.3      ;RT3's router ID
  6407.                    Advertising Router = 192.1.1.3 ;RT3's router ID
  6408.                    bit E = 0                      ;not an AS boundary router
  6409.                    bit B = 1                      ;RT3 is an area border router
  6410.                    #links = 1
  6411.                            Link ID = 18.10.0.6    ;Neighbor's Router ID
  6412.                            Link Data = 0.0.0.0    ;Interface to unnumbered SL
  6413.                            Type = 1               ;connects to router
  6414.                            # other metrics = 0
  6415.                            TOS 0 metric = 8
  6416.  
  6417.             Even though router RT3 has indicated that it is  TOS-capable
  6418.             in  the  above  examples,  only  a  single metric (the TOS 0
  6419.             metric) has been specified for  each  interface.   Different
  6420.             metrics  can be specified for each TOS.  The encoding of TOS
  6421.             in OSPF link state advertisements is  described  in  Section
  6422.             12.3.
  6423.  
  6424.             As an  example,  suppose  the  point-to-point  link  between
  6425.             routers  RT3  and RT6 in Figure 15 is a satellite link.  The
  6426.             AS administrator may want to encourage the use of  the  line
  6427.             for  high  bandwidth traffic.  This would be done by setting
  6428.             the metric artificially low for the appropriate  TOS  value.
  6429.             Router  RT3  would then originate the following router links
  6430.             advertisement  for  the   backbone   (TOS   8   =   maximize
  6431.             throughput):
  6432.  
  6433.                    ; RT3's router links advertisement for the backbone
  6434.  
  6435.                    LS age = 0                  ;always true on origination
  6436.                    Options = (T-bit|E-bit)     ;TOS-capable
  6437.  
  6438.  
  6439.  
  6440. [Moy]                                                         [Page 115]
  6441.  
  6442. Internet Draft               OSPF Version 2                November 1992
  6443.  
  6444.  
  6445.                    LS type = 1                 ;indicates router links
  6446.                    Link State ID = 192.1.1.3   ;RT3's Router ID
  6447.                    Advertising Router = 192.1.1.3
  6448.                    bit E = 0                   ;not an AS boundary router
  6449.                    bit B = 1                   ;RT3 is an area border router
  6450.                    #links = 1
  6451.                            Link ID = 18.10.0.6 ; Neighbor's Router ID
  6452.                            Link Data = 0.0.0.0 ;Interface to unnumbered SL
  6453.                            Type = 1            ;connects to router
  6454.                            # other metrics = 1
  6455.                            TOS 0 metric = 8
  6456.                                    TOS = 8     ;maximize throughput
  6457.                                    metric = 1  ;traffic preferred
  6458.  
  6459.  
  6460.         12.4.2.  Network links
  6461.  
  6462.             A network links advertisement is generated for every transit
  6463.             multi-access  network.  (A transit network is a network hav-
  6464.             ing two or more attached routers).  The network links adver-
  6465.             tisement  describes all the routers that are attached to the
  6466.             network.
  6467.  
  6468.             The Designated Router for the network originates the  adver-
  6469.             tisement.   The  Designated Router originates the advertise-
  6470.             ment only if it is fully adjacent  to  at  least  one  other
  6471.             router  on  the network.  The network links advertisement is
  6472.             flooded throughout the area that contains the  transit  net-
  6473.             work,  and  no  further.   The  networks links advertisement
  6474.             lists those routers that are fully adjacent  to  the  Desig-
  6475.             nated  Router;  each  fully adjacent router is identified by
  6476.             its OSPF Router ID.  The Designated Router  includes  itself
  6477.             in this list.
  6478.  
  6479.             The Link State ID for a network links advertisement  is  the
  6480.             IP  interface address of the Designated Router.  This value,
  6481.             masked by the network's address mask  (which  is  also  con-
  6482.             tained  in  the  network  links  advertisement)  yields  the
  6483.             network's IP address.
  6484.  
  6485.             A router that has formerly been the Designated Router for  a
  6486.             network,  but  is  no longer, should flush the network links
  6487.             advertisement  that  it  had  previously  originated.   This
  6488.             advertisement  is no longer used in the routing table calcu-
  6489.             lation.  It  is  flushed  by  prematurely  incrementing  the
  6490.             advertisement's  age  to  MaxAge and reflooding (see Section
  6491.             14.1).
  6492.  
  6493.  
  6494.  
  6495.  
  6496. [Moy]                                                         [Page 116]
  6497.  
  6498. Internet Draft               OSPF Version 2                November 1992
  6499.  
  6500.  
  6501.             As an example of a network links advertisement,  again  con-
  6502.             sider  the  area  configuration  in Figure 6.  Network links
  6503.             advertisements are originated for network N3 in Area 1, net-
  6504.             works N6 and N8 in Area 2, and network N9 in Area 3.  Assum-
  6505.             ing that router RT4 has  been  selected  as  the  Designated
  6506.             Router  for  network  N3, the following network links adver-
  6507.             tisement is generated by RT4 on behalf of  network  N3  (see
  6508.             Figure 15 for the address assignments):
  6509.  
  6510.                    ; network links advertisement for network N3
  6511.  
  6512.                    LS age = 0                     ;always true on origination
  6513.                    Options = (T-bit|E-bit)        ;TOS-capable
  6514.                    LS type = 2                    ;indicates network links
  6515.                    Link State ID = 192.1.1.4      ;IP address of Designated Router
  6516.                    Advertising Router = 192.1.1.4 ;RT4's Router ID
  6517.                    Network Mask = 0xffffff00
  6518.                            Attached Router = 192.1.1.4    ;Router ID
  6519.                            Attached Router = 192.1.1.1    ;Router ID
  6520.                            Attached Router = 192.1.1.2    ;Router ID
  6521.                            Attached Router = 192.1.1.3    ;Router ID
  6522.  
  6523.  
  6524.         12.4.3.  Summary links
  6525.  
  6526.             Each summary link advertisement describes a route to a  sin-
  6527.             gle  destination.   Summary  link advertisements are flooded
  6528.             throughout a single area only.  The destination described is
  6529.             one that is external to the area, yet still belonging to the
  6530.             Autonomous System.
  6531.  
  6532.             Summary link advertisements are originated  by  area  border
  6533.             routers.   The  precise  summary routes to advertise into an
  6534.             area are determined by examining the routing table structure
  6535.             (see  Section 11) in accordance with the algorithm described
  6536.             below. Note that only intra-area routes are advertised  into
  6537.             the  backbone,  while  both intra-area and inter-area routes
  6538.             are advertised into the other areas.
  6539.  
  6540.             To determine which routes to advertise into an attached Area
  6541.             A,  each  routing  table  entry  is  processed  as  follows.
  6542.             Remember that each routing table entry describes  a  set  of
  6543.             equal-cost best paths to a particular destination:
  6544.  
  6545.  
  6546.             o   Only Destination types of network and AS boundary router
  6547.                 are  advertised  in summary link advertisements.  If the
  6548.                 routing table entry's Destination type  is  area  border
  6549.  
  6550.  
  6551.  
  6552. [Moy]                                                         [Page 117]
  6553.  
  6554. Internet Draft               OSPF Version 2                November 1992
  6555.  
  6556.  
  6557.                 router, examine the next routing table entry.
  6558.  
  6559.             o   AS external routes are never advertised in summary  link
  6560.                 advertisements.   If  the  routing table entry has Path-
  6561.                 type of type 1 external or type 2 external, examine  the
  6562.                 next routing table entry.
  6563.  
  6564.             o   Else, if the area associated with this set of  paths  is
  6565.                 the Area A itself, do not generate a summary link adver-
  6566.                 tisement for the route.[14]
  6567.  
  6568.             o   Else, if the next hops associated with this set of paths
  6569.                 belong  to Area A itself, do not generate a summary link
  6570.                 advertisement for the route.[15]  This  is  the  logical
  6571.                 equivalent of a Distance Vector protocol's split horizon
  6572.                 logic.
  6573.  
  6574.             o   Else, if the routing table cost equals  or  exceeds  the
  6575.                 value LSInfinity, a summary link advertisement cannot be
  6576.                 generated for this route.
  6577.  
  6578.             o   Else, if the destination of this route is an AS boundary
  6579.                 router,  generate  a Type 4 link state advertisement for
  6580.                 the destination, with Link State  ID  equal  to  the  AS
  6581.                 boundary  router's  ID  and  metric equal to the routing
  6582.                 table entry's cost.  These advertisements should not  be
  6583.                 generated if area A has been configured as a stub area.
  6584.  
  6585.             o   Else, the Destination type is network.  If  this  is  an
  6586.                 inter-area  route,  generate  a Type 3 advertisement for
  6587.                 the  destination,  with  Link  State  ID  equal  to  the
  6588.                 network's  address  (if necessary, the Link State ID can
  6589.                 also have one or more of the network's  host  bits  set;
  6590.                 see  Appendix  F  for  details)  and metric equal to the
  6591.                 routing table cost.
  6592.  
  6593.             o   The one remaining case is an intra-area route to a  net-
  6594.                 work.   This  means that the network is contained in one
  6595.                 of the router's directly attached  areas.   In  general,
  6596.                 this  information  must be condensed before appearing in
  6597.                 summary link advertisements.  Remember that an area  has
  6598.                 been  defined  as  a  list of address ranges, each range
  6599.                 consisting of an [address,mask] pair and a status  indi-
  6600.                 cation of either Advertise or DoNotAdvertise.  At most a
  6601.                 single Type 3 advertisement is made for each range. When
  6602.                 the  range's status indicates Advertise, a Type 3 adver-
  6603.                 tisement is generated with Link State ID  equal  to  the
  6604.                 range's  address  (if  necessary,  the Link State ID can
  6605.  
  6606.  
  6607.  
  6608. [Moy]                                                         [Page 118]
  6609.  
  6610. Internet Draft               OSPF Version 2                November 1992
  6611.  
  6612.  
  6613.                 also have one or more of the range's  "host"  bits  set;
  6614.                 see  Appendix F for details) and cost equal to the smal-
  6615.                 lest cost of any of the  component  networks.  When  the
  6616.                 range's  status  indicates  DoNotAdvertise,  the  Type 3
  6617.                 advertisement is suppressed and the  component  networks
  6618.                 remain hidden from other areas.
  6619.  
  6620.                 By default, if a network is not contained in any  expli-
  6621.                 citly  configured  address range, a Type 3 advertisement
  6622.                 is generated with Link State ID equal to  the  network's
  6623.                 address  (if  necessary, the Link State ID can also have
  6624.                 one or more of the network's "host" bits set; see Appen-
  6625.                 dix  F  for  details)  and metric equal to the network's
  6626.                 routing table cost.
  6627.  
  6628.                 If virtual links are being used to provide/increase con-
  6629.                 nectivity  of the backbone, routing information concern-
  6630.                 ing the backbone networks should not be condensed before
  6631.                 being  summarized into the virtual links' transit areas.
  6632.                 Nor should the advertisement of backbone  networks  into
  6633.                 transit  areas  be  suppressed.   In  other  words,  the
  6634.                 backbone's configured ranges should be ignored when ori-
  6635.                 ginating   summary   links   into  transit  areas.   The
  6636.                 existence of virtual  links  is  determined  during  the
  6637.                 shortest  path  calculation  for  the transit areas (see
  6638.                 Section 16.1).
  6639.  
  6640.             If a router advertises a summary advertisement for a  desti-
  6641.             nation  which then becomes unreachable, the router must then
  6642.             flush the advertisement from the routing domain  by  setting
  6643.             its  age to MaxAge and reflooding (see Section 14.1).  Also,
  6644.             if the destination is still reachable, yet can no longer  be
  6645.             advertised according to the above procedure (e.g., it is now
  6646.             an inter-area route, when it used to be an intra-area  route
  6647.             associated  with  some  non-backbone  area; it would thus no
  6648.             longer be advertisable to the backbone),  the  advertisement
  6649.             should also be flushed from the routing domain.
  6650.  
  6651.             For an example  of  summary  link  advertisements,  consider
  6652.             again the area configuration in Figure 6.  Routers RT3, RT4,
  6653.             RT7, RT10 and RT11 are all area border routers,  and  there-
  6654.             fore are originating summary links advertisements.  Consider
  6655.             in particular router RT4.  Its routing table was  calculated
  6656.             as the example in Section 11.3.  RT4 originates summary link
  6657.             advertisements into both the backbone and Area 1.  Into  the
  6658.             backbone,  router RT4 originates separate advertisements for
  6659.             each of the networks N1-N4.  Into Area 1,  router  RT4  ori-
  6660.             ginates  separate  advertisements for networks N6-N8 and the
  6661.  
  6662.  
  6663.  
  6664. [Moy]                                                         [Page 119]
  6665.  
  6666. Internet Draft               OSPF Version 2                November 1992
  6667.  
  6668.  
  6669.             AS boundary routers RT5,RT7.  It also condenses host  routes
  6670.             Ia and Ib into a single summary advertisement.  Finally, the
  6671.             routes to networks N9,N10,N11 and host H9 are advertised  by
  6672.             a  single  summary  link.   This condensation was originally
  6673.             performed by the router RT11.
  6674.  
  6675.             These advertisements are illustrated graphically in  Figures
  6676.             7  and 8.  Two of the summary link advertisements originated
  6677.             by router RT4 follow.  The actual IP addresses for the  net-
  6678.             works  and  routers in question have been assigned in Figure
  6679.             15.
  6680.  
  6681.                    ; summary link advertisement for network N1,
  6682.                    ; originated by router RT4 into the backbone
  6683.  
  6684.                    LS age = 0                  ;always true on origination
  6685.                    Options = (T-bit|E-bit)     ;TOS-capable
  6686.                    LS type = 3                 ;indicates summary link to IP net
  6687.                    Link State ID = 192.1.2.0   ;N1's IP network number
  6688.                    Advertising Router = 192.1.1.4       ;RT4's ID
  6689.                            TOS = 0
  6690.                            metric = 4
  6691.  
  6692.                    ; summary link advertisement for AS boundary router RT7
  6693.                    ; originated by router RT4 into Area 1
  6694.  
  6695.                    LS age = 0                  ;always true on origination
  6696.                    Options = (T-bit|E-bit)     ;TOS-capable
  6697.                    LS type = 4                 ;indicates summary link to ASBR
  6698.                    Link State ID = router RT7's ID
  6699.                    Advertising Router = 192.1.1.4       ;RT4's ID
  6700.                            TOS = 0
  6701.                            metric = 14
  6702.  
  6703.             Summary link advertisements pertain to a single  destination
  6704.             (IP  network  or AS boundary router).  However, for a single
  6705.             destination there may be separate sets of paths, and  there-
  6706.             fore  separate  routing table entries, for each Type of Ser-
  6707.             vice.  All these entries must be  considered  when  building
  6708.             the summary link advertisement for the destination; a single
  6709.             advertisement must  specify  the  separate  costs  (if  they
  6710.             exist) for each TOS.  The encoding of TOS in OSPF link state
  6711.             advertisements is described in Section 12.3.
  6712.  
  6713.             Clearing the T-bit in the Options field of  a  summary  link
  6714.             advertisement  indicates  that  there is a TOS 0 path to the
  6715.             destination, but no paths for non-zero TOS.  This can happen
  6716.             when  non-TOS  capable  routers  exist in the routing domain
  6717.  
  6718.  
  6719.  
  6720. [Moy]                                                         [Page 120]
  6721.  
  6722. Internet Draft               OSPF Version 2                November 1992
  6723.  
  6724.  
  6725.             (see Section 2.4).
  6726.  
  6727.         12.4.4.  Originating summary links into stub areas
  6728.  
  6729.             The algorithm in Section 12.4.3 is optional when Area  A  is
  6730.             an  OSPF stub area. Area border routers connecting to a stub
  6731.             area can originate summary link advertisements into the area
  6732.             according to the above Section's algorithm, or can choose to
  6733.             originate only a  subset  of  the  advertisements,  possibly
  6734.             under  configuration control.  The fewer advertisements ori-
  6735.             ginated, the smaller the stub area's  link  state  database,
  6736.             further reducing the demands on its router's resources. How-
  6737.             ever, omitting advertisements may also lead  to  sub-optimal
  6738.             inter-area  routing, although routing will continue to func-
  6739.             tion.
  6740.  
  6741.             As specified in Section 12.4.3, Type 4 link state advertise-
  6742.             ments  (ASBR  summary  links) are never originated into stub
  6743.             areas.
  6744.  
  6745.             In stub areas only, the DefaultDestination can be  specified
  6746.             in  summary link advertisements (see Section 3.6). In a stub
  6747.             area, instead of importing external routes each area  border
  6748.             router  originates a "default summary link" (Link State ID =
  6749.             DefaultDestination) into the area. The Link State ID for the
  6750.             default  summary  link is set to DefaultDestination, and the
  6751.             metric set to the (per-area) configurable parameter  StubDe-
  6752.             faultCost.  Note that StubDefaultCost need not be configured
  6753.             identically in all of the stub area's area border routers.
  6754.  
  6755.         12.4.5.  AS external links
  6756.  
  6757.             AS external link advertisements describe routes to  destina-
  6758.             tions  external  to the Autonomous System.  Most AS external
  6759.             link advertisements describe  routes  to  specific  external
  6760.             destinations;  in these cases the advertisement's Link State
  6761.             ID is set to the destination network's IP address (if neces-
  6762.             sary,  the  Link  State  ID can also have one or more of the
  6763.             network's "host" bits set;  see  Appendix  F  for  details).
  6764.             However,  a  default  route for the Autonomous System can be
  6765.             described in an AS external  advertisement  by  setting  the
  6766.             advertisement's   Link   State   ID   to  DefaultDestination
  6767.             (0.0.0.0).  AS external link advertisements  are  originated
  6768.             by  AS boundary routers.  An AS boundary router originates a
  6769.             single AS external  link  advertisement  for  each  external
  6770.             route  that  it  has learned, either through another routing
  6771.             protocol (such as EGP), or  through  configuration  informa-
  6772.             tion.
  6773.  
  6774.  
  6775.  
  6776. [Moy]                                                         [Page 121]
  6777.  
  6778. Internet Draft               OSPF Version 2                November 1992
  6779.  
  6780.  
  6781.             In general, AS external link  advertisements  are  the  only
  6782.             type   of   link   state  advertisements  that  are  flooded
  6783.             throughout the entire Autonomous System; all other types  of
  6784.             link  state  advertisements  are  specific to a single area.
  6785.             However,  AS  external  advertisements   are   not   flooded
  6786.             into/throughout  stub areas (see Section 3.6).  This enables
  6787.             a reduction in link state database size for routers internal
  6788.             to stub areas.
  6789.  
  6790.             The metric that is advertised for an external route  can  be
  6791.             one of two types.  Type 1 metrics are comparable to the link
  6792.             state metric.  Type 2 metrics are assumed to be larger  than
  6793.             the  cost of any intra-AS path.  As with summary link adver-
  6794.             tisements, if separate paths exist based  on  TOS,  separate
  6795.             TOS costs can be included in the AS external link advertise-
  6796.             ment.  The encoding of TOS in OSPF link state advertisements
  6797.             is   described  in  Section  12.3.   If  the  T-bit  of  the
  6798.             advertisement's Options field  is  clear,  no  non-zero  TOS
  6799.             paths to the destination exist.
  6800.  
  6801.             If a router advertises an AS external link advertisement for
  6802.             a  destination  which  then  becomes unreachable, the router
  6803.             must then flush the advertisement from the routing domain by
  6804.             setting its age to MaxAge and reflooding (see Section 14.1).
  6805.  
  6806.             For an example of AS external link advertisements,  consider
  6807.             once  again  the  AS pictured in Figure 6.  There are two AS
  6808.             boundary routers: RT5 and RT7.  Router RT5 originates  three
  6809.             external  link advertisements, for networks N12-N14.  Router
  6810.             RT7 originates two external link  advertisements,  for  net-
  6811.             works N12 and N15.  Assume that RT7 has learned its route to
  6812.             N12 via EGP, and that it wishes to advertise a Type 2 metric
  6813.             to  the  AS.   RT7 would then originate the following adver-
  6814.             tisement for N12:
  6815.  
  6816.                    ; AS external link advertisement for network N12,
  6817.                    ; originated by router RT7
  6818.  
  6819.                    LS age = 0                  ;always true on origination
  6820.                    Options = (T-bit|E-bit)     ;TOS-capable
  6821.                    LS type = 5                 ;indicates AS external link
  6822.                    Link State ID = N12's IP network number
  6823.                    Advertising Router = Router RT7's ID
  6824.                            bit E = 1           ;Type 2 metric
  6825.                            TOS = 0
  6826.                            metric = 2
  6827.                            Forwarding address = 0.0.0.0
  6828.  
  6829.  
  6830.  
  6831.  
  6832. [Moy]                                                         [Page 122]
  6833.  
  6834. Internet Draft               OSPF Version 2                November 1992
  6835.  
  6836.  
  6837.             In the above example, the forwarding address field has  been
  6838.             set  to  0.0.0.0,  indicating  that packets for the external
  6839.             destination should be  forwarded  to  the  advertising  OSPF
  6840.             router  (RT7).   This is not always desirable.  Consider the
  6841.             example pictured in Figure 16.  There are three OSPF routers
  6842.             (RTA,  RTB and RTC) connected to a common network.  Only one
  6843.             of these routers, RTA, is exchanging  EGP  information  with
  6844.             the  non-OSPF router RTX.  RTA must then originate AS exter-
  6845.             nal link state advertisements for those destinations it  has
  6846.             learned  from RTX.  By using the AS external advertisement's
  6847.             forwarding address field, RTA can specify that  packets  for
  6848.             these  destinations  be  forwarded directly to RTX.  Without
  6849.             this feature, routers RTB and RTC would take an extra hop to
  6850.             get to these destinations.
  6851.  
  6852.             Note that when the forwarding address field is non-zero,  it
  6853.             should  point  to  a  router belonging to another Autonomous
  6854.             System.
  6855.  
  6856.             A forwarding address can also be specified for  the  default
  6857.             route.   For  example,  in figure 16 RTA may want to specify
  6858.             that all externally-destined packets should  by  default  be
  6859.             forwarded  to  its  EGP peer RTX.  The resulting AS external
  6860.             link advertisement is pictured below.  Note  that  the  Link
  6861.             State ID is set to DefaultDestination.
  6862.  
  6863.                    ; Default route, originated by router RTA
  6864.                    ; Packets forwarded through RTX
  6865.  
  6866.                    LS age = 0                  ;always true on origination
  6867.                    Options = (T-bit|E-bit)     ;TOS-capable
  6868.                    LS type = 5                 ;indicates AS external link
  6869.                    Link State ID = DefaultDestination  ; default route
  6870.                    Advertising Router = Router RTA's ID
  6871.                            bit E = 1           ;Type 2 metric
  6872.                            TOS = 0
  6873.                            metric = 1
  6874.                            Forwarding address = RTX's IP address
  6875.  
  6876.             In figure 16, suppose instead that both RTA and RTB exchange
  6877.             EGP  information  with RTX.  In this case, RTA and RTB would
  6878.             originate the same set of  external  advertisements.   These
  6879.             advertisements,  if  they  specify the same metric, would be
  6880.             functionally equivalent since they would  specify  the  same
  6881.             destination  and  forwarding address (RTX).  This leads to a
  6882.             clear duplication of effort.  If only one of RTA or RTB ori-
  6883.             ginated  the  set  of  external  advertisements, the routing
  6884.             would remain the same,  and  the  size  of  the  link  state
  6885.  
  6886.  
  6887.  
  6888. [Moy]                                                         [Page 123]
  6889.  
  6890. Internet Draft               OSPF Version 2                November 1992
  6891.  
  6892.  
  6893.             database  would decrease.  However, it must be unambiguously
  6894.             defined as to which  router  originates  the  advertisements
  6895.             (otherwise  neither  may,  or the identity of the originator
  6896.             may oscillate).  The following rule is thereby  established:
  6897.             if  two  routers, both reachable from one another, originate
  6898.             functionally equivalent AS  external  advertisements  (i.e.,
  6899.             same  destination,  cost  and  non-zero forwarding address),
  6900.             then the advertisement originated by the router  having  the
  6901.             highest OSPF Router ID is used.  The router having the lower
  6902.             OSPF Router ID can then flush its advertisement.  Flushing a
  6903.             link state advertisement is discussed in Section 14.1.
  6904.  
  6905. 13.  The Flooding Procedure
  6906.  
  6907.     Link State Update packets provide the mechanism  for  flooding  link
  6908.     state  advertisements.   A  Link  State  Update  packet  may contain
  6909.     several distinct advertisements, and floods each  advertisement  one
  6910.     hop  further  from  its  point of origination.  To make the flooding
  6911.     procedure  reliable,  each  advertisement   must   be   acknowledged
  6912.     separately.   Acknowledgments  are  transmitted  in  Link State Ack-
  6913.     nowledgment packets.  Many separate acknowledgments can  be  grouped
  6914.     together into a single packet.
  6915.  
  6916.     The flooding procedure starts when a Link State  Update  packet  has
  6917.     been  received.   Many  consistency  checks  have  been  made on the
  6918.     received packet before being handed to the flooding  procedure  (see
  6919.     Section  8.2).  In particular, the Link State Update packet has been
  6920.  
  6921.                                 +
  6922.                                 |
  6923.                       +---+.....|.EGP
  6924.                       |RTA|-----|.....+---+
  6925.                       +---+     |-----|RTX|
  6926.                                 |     +---+
  6927.                       +---+     |
  6928.                       |RTB|-----|
  6929.                       +---+     |
  6930.                                 |
  6931.                       +---+     |
  6932.                       |RTC|-----|
  6933.                       +---+     |
  6934.                                 |
  6935.                                 +
  6936.  
  6937.  
  6938.                Figure 16: Forwarding address example
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944. [Moy]                                                         [Page 124]
  6945.  
  6946. Internet Draft               OSPF Version 2                November 1992
  6947.  
  6948.  
  6949.     associated with a particular neighbor, and a  particular  area.   If
  6950.     the  neighbor  is in a lesser state than Exchange, the packet should
  6951.     be dropped without further processing.
  6952.  
  6953.     All types of link  state  advertisements,  other  than  AS  external
  6954.     links,  are  associated  with  a specific area.  However, link state
  6955.     advertisements  do  not  contain  an  area  field.   A  link   state
  6956.     advertisement's  area  must  be  deduced  from the Link State Update
  6957.     packet header.
  6958.  
  6959.     For each link state advertisement contained in the packet, the  fol-
  6960.     lowing steps are taken:
  6961.  
  6962.  
  6963.     (1) Validate the advertisement's link state checksum.  If the check-
  6964.         sum  turns  out to be invalid, discard the advertisement and get
  6965.         the next one from the Link State Update packet.
  6966.  
  6967.     (2) Examine the link state advertisement's LS type.  If the LS  type
  6968.         is  unknown, discard the advertisement and get the next one from
  6969.         the Link State Update Packet.   This  specification  defines  LS
  6970.         Types 1-5 (see Section 4.3).
  6971.  
  6972.     (3) Else if this is a AS external advertisement (LS type =  5),  and
  6973.         the  area has been configured as a stub area, discard the adver-
  6974.         tisement and get the next one from the Link State Update Packet.
  6975.         AS  external advertisements are not flooded into/throughout stub
  6976.         areas (see Section 3.6).
  6977.  
  6978.     (4) Else if the advertisement's age is equal to MaxAge, and there is
  6979.         currently  no instance of the advertisement in the router's link
  6980.         state database, then take the following actions:
  6981.  
  6982.         (a) Acknowledge the receipt of the advertisement  by  sending  a
  6983.             Link  State Acknowledgment packet back to the sending neigh-
  6984.             bor (see Section 13.5).
  6985.  
  6986.         (b) Purge  all  outstanding  requests  for  equal  or   previous
  6987.             instances  of  the advertisement from the sending neighbor's
  6988.             Link State Request list (see Section 10).
  6989.  
  6990.         (c) If the sending neighbor is in state  Exchange  or  in  state
  6991.             Loading,  then  install the MaxAge advertisement in the link
  6992.             state database.  Otherwise, simply  discard  the  advertise-
  6993.             ment.   In  either  case, examine the next advertisement (if
  6994.             any) listed in the Link State Update packet.
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000. [Moy]                                                         [Page 125]
  7001.  
  7002. Internet Draft               OSPF Version 2                November 1992
  7003.  
  7004.  
  7005.     (5) Otherwise, find the  instance  of  this  advertisement  that  is
  7006.         currently  contained  in  the  router's link state database.  If
  7007.         there is no database copy, or the received advertisement is more
  7008.         recent  than  the  database copy (see Section 13.1 below for the
  7009.         determination of which advertisement is more recent) the follow-
  7010.         ing steps must be performed:
  7011.  
  7012.         (a) If there is already a database copy,  and  if  the  database
  7013.             copy was installed less than MinLSInterval seconds ago, dis-
  7014.             card the new advertisement (without  acknowledging  it)  and
  7015.             examine  the  next advertisement (if any) listed in the Link
  7016.             State Update packet.
  7017.  
  7018.         (b) Otherwise immediately flood the new advertisement  out  some
  7019.             subset  of  the  router's interfaces (see Section 13.3).  In
  7020.             some cases (e.g., the state of the receiving interface is DR
  7021.             and  the advertisement was received from a router other than
  7022.             the Backup DR) the advertisement will be  flooded  back  out
  7023.             the  receiving  interface.   This occurrence should be noted
  7024.             for later use by the acknowledgment process (Section 13.5).
  7025.  
  7026.         (c) Remove the current database copy from  all  neighbors'  Link
  7027.             state retransmission lists.
  7028.  
  7029.         (d) Install the new advertisement in  the  link  state  database
  7030.             (replacing  the  current database copy).  This may cause the
  7031.             routing table calculation to  be  scheduled.   In  addition,
  7032.             timestamp the new advertisement with the current time (i.e.,
  7033.             the time it was received).  The  flooding  procedure  cannot
  7034.             overwrite  the  newly installed advertisement until MinLSIn-
  7035.             terval seconds have elapsed.  The advertisement installation
  7036.             process is discussed further in Section 13.2.
  7037.  
  7038.         (e) Possibly acknowledge the receipt  of  the  advertisement  by
  7039.             sending  a  Link  State  Acknowledgment  packet back out the
  7040.             receiving interface.  This is  explained  below  in  Section
  7041.             13.5.
  7042.  
  7043.         (f) If this new link state advertisement indicates that  it  was
  7044.             originated  by  this  router itself, the router must advance
  7045.             the advertisement's link state sequence number, and issue  a
  7046.             new instance of the advertisement (see Section 13.4).
  7047.  
  7048.     (6) Else, if there is an instance of the advertisement on the  send-
  7049.         ing neighbor's Link state request list, an error has occurred in
  7050.         the Database Description process.  In  this  case,  restart  the
  7051.         Database  Description  process  by generating the neighbor event
  7052.         BadLSReq for the sending neighbor and stop processing  the  Link
  7053.  
  7054.  
  7055.  
  7056. [Moy]                                                         [Page 126]
  7057.  
  7058. Internet Draft               OSPF Version 2                November 1992
  7059.  
  7060.  
  7061.         State Update packet.
  7062.  
  7063.     (7) Else, if the received advertisement is the same instance as  the
  7064.         database  copy  (i.e., neither one is more recent) the following
  7065.         two steps should be performed:
  7066.  
  7067.         (a) If the advertisement is listed in the Link state retransmis-
  7068.             sion  list for the receiving adjacency, the router itself is
  7069.             expecting an acknowledgment  for  this  advertisement.   The
  7070.             router  should  treat  the received advertisement as an ack-
  7071.             nowledgment, by removing the  advertisement  from  the  Link
  7072.             state  retransmission list.  This is termed an "implied ack-
  7073.             nowledgment".  Its occurrence should be noted for later  use
  7074.             by the acknowledgment process (Section 13.5).
  7075.  
  7076.         (b) Possibly acknowledge the receipt  of  the  advertisement  by
  7077.             sending  a  Link  State  Acknowledgment  packet back out the
  7078.             receiving interface.  This is  explained  below  in  Section
  7079.             13.5.
  7080.  
  7081.     (8) Else, the database copy is more recent.  Note an  unusual  event
  7082.         to network management, discard the advertisement and process the
  7083.         next link state advertisement contained in the packet.
  7084.  
  7085.  
  7086.     13.1.  Determining which link state is newer
  7087.  
  7088.         When a router encounters two instances of a  link  state  adver-
  7089.         tisement, it must determine which is more recent.  This occurred
  7090.         above when comparing a received advertisement  to  the  database
  7091.         copy.   This  comparison  must  also be done during the database
  7092.         exchange procedure which occurs during adjacency bring-up.
  7093.  
  7094.         A link state advertisement is identified by its  LS  type,  Link
  7095.         State  ID and Advertising Router.  For two instances of the same
  7096.         advertisement, the LS sequence number, LS age, and  LS  checksum
  7097.         fields are used to determine which instance is more recent:
  7098.  
  7099.  
  7100.         o   The advertisement having the newer  LS  sequence  number  is
  7101.             more  recent.   See Section 12.1.6 for an explanation of the
  7102.             LS sequence number space.  If both instances have  the  same
  7103.             LS sequence number, then:
  7104.  
  7105.         o   If the two instances have different LS checksums,  then  the
  7106.             instance having the larger LS checksum (when considered as a
  7107.             16-bit unsigned integer) is considered more recent.
  7108.  
  7109.  
  7110.  
  7111.  
  7112. [Moy]                                                         [Page 127]
  7113.  
  7114. Internet Draft               OSPF Version 2                November 1992
  7115.  
  7116.  
  7117.         o   Else, if only one of the instances is  of  age  MaxAge,  the
  7118.             instance of age MaxAge is considered to be more recent.
  7119.  
  7120.         o   Else, if the ages of the two instances differ by  more  than
  7121.             MaxAgeDiff, the instance having the smaller (younger) age is
  7122.             considered to be more recent.
  7123.  
  7124.         o   Else, the two instances are considered to be identical.
  7125.  
  7126.  
  7127.     13.2.  Installing link state advertisements in the database
  7128.  
  7129.         Installing a new  link  state  advertisement  in  the  database,
  7130.         either  as  the  result  of  flooding or a newly self originated
  7131.         advertisement, may cause  the  routing  table  structure  to  be
  7132.         recalculated.   The  contents of the new advertisement should be
  7133.         compared to the old  instance,  if  present.   If  there  is  no
  7134.         difference,  there  is no need to recalculate the routing table.
  7135.         (Note that even if the contents are the same,  the  LS  checksum
  7136.         will  probably  be  different,  since the checksum covers the LS
  7137.         sequence number.)
  7138.  
  7139.         If the contents are different, the following pieces of the rout-
  7140.         ing table must be recalculated, depending on the LS type field:
  7141.  
  7142.  
  7143.         Router links, network links
  7144.             The entire routing table must be recalculated, starting with
  7145.             the  shortest  path calculations for each area (not just the
  7146.             area whose topological database has  changed).   The  reason
  7147.             that  the  shortest path calculation cannot be restricted to
  7148.             the single changed area has to do  with  the  fact  that  AS
  7149.             boundary  routers may belong to multiple areas.  A change in
  7150.             the area currently providing the best route  may  force  the
  7151.             router  to  use  an intra-area route provided by a different
  7152.             area.[16]
  7153.  
  7154.         Summary link
  7155.             The best route to the destination described by  the  summary
  7156.             link  advertisement  must be re-examined (see Section 16.5).
  7157.             If this destination is an AS boundary router, it may also be
  7158.             necessary  to re-examine all the AS external link advertise-
  7159.             ments.
  7160.  
  7161.         AS external link
  7162.             The best route to the destination described by the AS exter-
  7163.             nal  link  advertisement  must  be  re-examined (see Section
  7164.             16.6).
  7165.  
  7166.  
  7167.  
  7168. [Moy]                                                         [Page 128]
  7169.  
  7170. Internet Draft               OSPF Version 2                November 1992
  7171.  
  7172.  
  7173.         Also, any old instance of the advertisement must be removed from
  7174.         the  database when the new advertisement is installed.  This old
  7175.         instance must also be removed from  all  neighbors'  Link  state
  7176.         retransmission lists (see Section 10).
  7177.  
  7178.  
  7179.     13.3.  Next step in the flooding procedure
  7180.  
  7181.         When a new (and more recent) advertisement has been received, it
  7182.         must  be  flooded out some set of the router's interfaces.  This
  7183.         section describes the second part  of  flooding  procedure  (the
  7184.         first  part  being  the processing that occurred in Section 13),
  7185.         namely, selecting the outgoing interfaces and adding the  adver-
  7186.         tisement to the appropriate neighbors' Link state retransmission
  7187.         lists.  Also included in this part of the flooding procedure  is
  7188.         the maintenance of the neighbors' Link state request lists.
  7189.  
  7190.         This section is equally applicable to the flooding of an  adver-
  7191.         tisement that the router itself has just originated (see Section
  7192.         12.4).  For these  advertisements,  this  section  provides  the
  7193.         entirety of the flooding procedure (i.e., the processing of Sec-
  7194.         tion 13 is not performed, since, for example, the  advertisement
  7195.         has  not  been  received  from a neighbor and therefore does not
  7196.         need to be acknowledged).
  7197.  
  7198.         Depending upon the advertisement's LS  type,  the  advertisement
  7199.         can  be  flooded out only certain interfaces.  These interfaces,
  7200.         defined by the following, are called the eligible interfaces:
  7201.  
  7202.  
  7203.         AS external links (LS Type = 5)
  7204.             AS external links are flooded throughout the entire AS, with
  7205.             the exception of stub areas (see Section 3.6).  The eligible
  7206.             interfaces are all the router's interfaces,  excluding  vir-
  7207.             tual links and those interfaces attaching to stub areas.
  7208.  
  7209.         All other types
  7210.             All other types are specific to a single area (Area A).  The
  7211.             eligible  interfaces  are  all those interfaces attaching to
  7212.             the Area A.  If Area A is the backbone,  this  includes  all
  7213.             the virtual links.
  7214.  
  7215.  
  7216.         Link state databases must remain synchronized over all  adjacen-
  7217.         cies  associated  with  the  above eligible interfaces.  This is
  7218.         accomplished by executing the following steps on  each  eligible
  7219.         interface.   It  should  be noted that this procedure may decide
  7220.         not to  flood  a  link  state  advertisement  out  a  particular
  7221.  
  7222.  
  7223.  
  7224. [Moy]                                                         [Page 129]
  7225.  
  7226. Internet Draft               OSPF Version 2                November 1992
  7227.  
  7228.  
  7229.         interface,  if  there  is  a  high probability that the attached
  7230.         neighbors have already received the advertisement.  However,  in
  7231.         these  cases the flooding procedure must be absolutely sure that
  7232.         the neighbors eventually do receive the  advertisement,  so  the
  7233.         advertisement  is  still  added  to  each adjacency's Link state
  7234.         retransmission list.  For each eligible interface:
  7235.  
  7236.  
  7237.         (1) Each of the neighbors attached to this interface  are  exam-
  7238.             ined,  to determine whether they must receive the new adver-
  7239.             tisement.  The following steps are executed for each  neigh-
  7240.             bor:
  7241.  
  7242.             (a) If the neighbor is in a lesser state than  Exchange,  it
  7243.                 does  not participate in flooding, and the next neighbor
  7244.                 should be examined.
  7245.  
  7246.             (b) Else, if the adjacency is not yet full  (neighbor  state
  7247.                 is  Exchange or Loading), examine the Link state request
  7248.                 list associated with this adjacency.   If  there  is  an
  7249.                 instance  of the new advertisement on the list, it indi-
  7250.                 cates that the neighboring router has an instance of the
  7251.                 advertisement already.  Compare the new advertisement to
  7252.                 the neighbor's copy:
  7253.  
  7254.                 o   If the new advertisement is less  recent,  then  try
  7255.                     the next neighbor.
  7256.  
  7257.                 o   If the two copies are the same instance, then delete
  7258.                     the  advertisement from the Link state request list,
  7259.                     and try the next neighbor.[17]
  7260.  
  7261.                 o   Else, the new advertisement is more recent.   Delete
  7262.                     the advertisement from the Link state request list.
  7263.  
  7264.             (c) If the new advertisement was received from  this  neigh-
  7265.                 bor, try the next neighbor.
  7266.  
  7267.             (d) At this point we are not positive that the new  neighbor
  7268.                 has  an  up-to-date  instance of this new advertisement.
  7269.                 Add the new advertisement to the Link state  retransmis-
  7270.                 sion  list  for  the  adjacency.   This ensures that the
  7271.                 flooding procedure is reliable; the  advertisement  will
  7272.                 be retransmitted at intervals until an acknowledgment is
  7273.                 seen from the neighbor.
  7274.  
  7275.         (2) The router must now decide whether to  flood  the  new  link
  7276.             state  advertisement out this interface.  If in the previous
  7277.  
  7278.  
  7279.  
  7280. [Moy]                                                         [Page 130]
  7281.  
  7282. Internet Draft               OSPF Version 2                November 1992
  7283.  
  7284.  
  7285.             step, the link state advertisement was NOT added to  any  of
  7286.             the  Link  state  retransmission  lists, there is no need to
  7287.             flood the advertisement and the  next  interface  should  be
  7288.             examined.
  7289.  
  7290.         (3) If the new advertisement was received on this interface, and
  7291.             it  was  received  from  either the Designated Router or the
  7292.             Backup Designated Router, chances are all the neighbors have
  7293.             received  the advertisement already.  Therefore, examine the
  7294.             next interface.
  7295.  
  7296.         (4) If the new advertisement was received on this interface, and
  7297.             the  interface  state  is Backup (i.e., the router itself is
  7298.             the Backup Designated Router), examine the  next  interface.
  7299.             The  Designated  Router  will do the flooding on this inter-
  7300.             face.  If the Designated Router fails, this router will  end
  7301.             up retransmitting the updates.
  7302.  
  7303.         (5) If this step is reached, the advertisement must  be  flooded
  7304.             out  the  interface.   Send a Link State Update packet (with
  7305.             the new advertisement as contents) out the  interface.   The
  7306.             advertisement's  LS age must be incremented by InfTransDelay
  7307.             (which must be > 0) when copied  into  the  outgoing  packet
  7308.             (until  the  LS  age field reaches its maximum value of Max-
  7309.             Age).
  7310.  
  7311.             On broadcast networks, the Link  State  Update  packets  are
  7312.             multicast.   The  destination  IP  address specified for the
  7313.             Link State Update Packet depends on the state of the  inter-
  7314.             face.   If  the interface state is DR or Backup, the address
  7315.             AllSPFRouters  should  be  used.   Otherwise,  the   address
  7316.             AllDRouters should be used.
  7317.  
  7318.             On non-broadcast, multi-access networks, separate Link State
  7319.             Update  packets  must be sent, as unicasts, to each adjacent
  7320.             neighbor (i.e., those in state Exchange  or  greater).   The
  7321.             destination  IP  addresses  for these packets are the neigh-
  7322.             bors' IP addresses.
  7323.  
  7324.  
  7325.     13.4.  Receiving self-originated link state
  7326.  
  7327.         It is a common occurrence  to  receive  a  self-originated  link
  7328.         state  advertisement  via the flooding procedure.  If the adver-
  7329.         tisement received is a newer instance  than  the  last  instance
  7330.         that  the  router actually originated, the router must take spe-
  7331.         cial action.
  7332.  
  7333.  
  7334.  
  7335.  
  7336. [Moy]                                                         [Page 131]
  7337.  
  7338. Internet Draft               OSPF Version 2                November 1992
  7339.  
  7340.  
  7341.         The reception of such an advertisement indicates that there  are
  7342.         link  state  advertisements in the routing domain that were ori-
  7343.         ginated before the last time the router was restarted.  In  this
  7344.         case, the router must advance the sequence number for the adver-
  7345.         tisement one past the received sequence number, and originate  a
  7346.         new instance of the advertisement.
  7347.  
  7348.         Note also that if the type of the advertisement is Summary  link
  7349.         or AS external link, the router may no longer have an (advertis-
  7350.         able) route to the destination.  In this case, the advertisement
  7351.         should  be  flushed  from the routing domain by incrementing the
  7352.         advertisement's LS age to MaxAge  and  reflooding  (see  Section
  7353.         14.1).
  7354.  
  7355.  
  7356.     13.5.  Sending Link State Acknowledgment packets
  7357.  
  7358.         Each newly  received  link  state  advertisement  must  be  ack-
  7359.         nowledged.   This  is  usually  done  by sending Link State Ack-
  7360.         nowledgment  packets.   However,  acknowledgments  can  also  be
  7361.         accomplished  implicitly  by  sending  Link State Update packets
  7362.         (see step 7a of Section 13).
  7363.  
  7364.         Many acknowledgments may be grouped together into a single  Link
  7365.         State Acknowledgment packet.  Such a packet is sent back out the
  7366.         interface that has received the advertisements.  The packet  can
  7367.         be  sent  in  one  of  two ways: delayed and sent on an interval
  7368.         timer, or sent directly (as a unicast) to a particular neighbor.
  7369.         The  particular acknowledgment strategy used depends on the cir-
  7370.         cumstances surrounding the receipt of the advertisement.
  7371.  
  7372.         Sending delayed acknowledgments accomplishes several things:  it
  7373.         facilitates  the packaging of multiple acknowledgments in a sin-
  7374.         gle packet; it enables a single packet to  indicate  acknowledg-
  7375.         ments  to  several neighbors at once (through multicasting); and
  7376.         it randomizes the acknowledgment packets  sent  by  the  various
  7377.         routers  attached to a multi-access network.  The fixed interval
  7378.         between a router's delayed transmissions  must  be  short  (less
  7379.         than RxmtInterval) or needless retransmissions will ensue.
  7380.  
  7381.         Direct acknowledgments are sent  to  a  particular  neighbor  in
  7382.         response  to the receipt of duplicate link state advertisements.
  7383.         These acknowledgments are sent as unicasts, and are sent immedi-
  7384.         ately when the duplicate is received.
  7385.  
  7386.         The precise procedure  for  sending  Link  State  Acknowledgment
  7387.         packets is described in Table 19.  The circumstances surrounding
  7388.         the receipt of the advertisement are listed in the left  column.
  7389.  
  7390.  
  7391.  
  7392. [Moy]                                                         [Page 132]
  7393.  
  7394. Internet Draft               OSPF Version 2                November 1992
  7395.  
  7396.  
  7397.         The acknowledgment action then taken is listed in one of the two
  7398.         right columns.  This action depends on the  state  of  the  con-
  7399.         cerned  interface; interfaces in state Backup behave differently
  7400.         from interfaces in all other  states.   Delayed  acknowledgments
  7401.  
  7402.  
  7403.                                      Action taken in state
  7404.      Circumstances          Backup               All other states
  7405.      ______________________________________________________________
  7406.      Advertisement  has     No  acknowledgment   No  acknowledgment
  7407.      been  flooded back     sent.                sent.
  7408.      out receiving  in-
  7409.      terface  (see Sec-
  7410.      tion 13, step 5b).
  7411.      ______________________________________________________________
  7412.      Advertisement   is     Delayed       ack-   Delayed       ack-
  7413.      more  recent  than     nowledgment   sent   nowledgment sent.
  7414.      database copy, but     if   advertisement
  7415.      was   not  flooded     received  from DR,
  7416.      back out receiving     otherwise do noth-
  7417.      interface              ing
  7418.      ______________________________________________________________
  7419.      Advertisement is a     Delayed       ack-   No  acknowledgment
  7420.      duplicate, and was     nowledgment   sent   sent.
  7421.      treated as an  im-     if   advertisement
  7422.      plied  acknowledg-     received  from DR,
  7423.      ment (see  Section     otherwise do noth-
  7424.      13, step 7a).          ing
  7425.      ______________________________________________________________
  7426.      Advertisement is a     Direct acknowledg-   Direct acknowledg-
  7427.      duplicate, and was     ment sent.           ment sent.
  7428.      not treated as  an
  7429.      implied       ack-
  7430.      nowledgment.
  7431.      ______________________________________________________________
  7432.      Advertisement's age    Direct acknowledg-   Direct acknowledg-
  7433.      is equal to MaxAge,    ment sent.           ment sent.
  7434.      and there is no
  7435.      current instance of
  7436.      the advertisement in
  7437.      the link state
  7438.      database (see
  7439.      Section 13, step 4).
  7440.  
  7441.  
  7442.              Table 19: Sending link state acknowledgements.
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448. [Moy]                                                         [Page 133]
  7449.  
  7450. Internet Draft               OSPF Version 2                November 1992
  7451.  
  7452.  
  7453.         must be delivered to all adjacent routers  associated  with  the
  7454.         interface.  On broadcast networks, this is accomplished by send-
  7455.         ing the delayed Link State Acknowledgment packets as multicasts.
  7456.         The  Destination  IP  address  used  depends on the state of the
  7457.         interface.  If the  state  is  DR  or  Backup,  the  destination
  7458.         AllSPFRouters   is  used.   In  other  states,  the  destination
  7459.         AllDRouters is used.  On non-broadcast  networks,  delayed  acks
  7460.         must  be  unicast separately over each adjacency (neighbor whose
  7461.         state is >= Exchange).
  7462.  
  7463.         The reasoning behind sending the above packets as multicasts  is
  7464.         best  explained  by an example.  Consider the network configura-
  7465.         tion depicted in Figure 15.  Suppose RT4 has been elected as DR,
  7466.         and  RT3 as Backup for the network N3.  When router RT4 floods a
  7467.         new advertisement to network N3, it is received by routers  RT1,
  7468.         RT2,  and  RT3.   These routers will not flood the advertisement
  7469.         back onto net N3, but they still must ensure that their topolog-
  7470.         ical  databases  remain  synchronized with their adjacent neigh-
  7471.         bors.  So RT1, RT2, and RT4 are waiting to see an acknowledgment
  7472.         from  RT3.   Likewise,  RT4 and RT3 are both waiting to see ack-
  7473.         nowledgments from RT1 and RT2.  This is best achieved by sending
  7474.         the acknowledgments as multicasts.
  7475.  
  7476.         The reason that the  acknowledgment  logic  for  Backup  DRs  is
  7477.         slightly  different  is  because they perform differently during
  7478.         the flooding of link state  advertisements  (see  Section  13.3,
  7479.         step 4).
  7480.  
  7481.  
  7482.  
  7483.     13.6.  Retransmitting link state advertisements
  7484.  
  7485.         Advertisements flooded  out  an  adjacency  are  placed  on  the
  7486.         adjacency's  Link state retransmission list.  In order to ensure
  7487.         that flooding is reliable, these advertisements are  retransmit-
  7488.         ted  until  they  are  acknowledged.  The length of time between
  7489.         retransmissions is a configurable per-interface  value,  RxmtIn-
  7490.         terval.   If  this  is  set  too  low for an interface, needless
  7491.         retransmissions will ensue.  If the value is set too  high,  the
  7492.         speed  of  the  flooding,  in  the  face of lost packets, may be
  7493.         affected.
  7494.  
  7495.         Several retransmitted advertisements may fit into a single  Link
  7496.         State  Update packet.  When advertisements are to be retransmit-
  7497.         ted, only the number fitting  in  a  single  Link  State  Update
  7498.         packet should be transmitted.  Another packet of retransmissions
  7499.         can be sent when some of the advertisements are acknowledged, or
  7500.         on the next firing of the retransmission timer.
  7501.  
  7502.  
  7503.  
  7504. [Moy]                                                         [Page 134]
  7505.  
  7506. Internet Draft               OSPF Version 2                November 1992
  7507.  
  7508.  
  7509.         Link State Update Packets carrying  retransmissions  are  always
  7510.         sent as unicasts (directly to the physical address of the neigh-
  7511.         bor).  They are never sent as multicasts.  Each  advertisement's
  7512.         LS  age must be incremented by InfTransDelay (which must be > 0)
  7513.         when copied into the outgoing packet (until  the  LS  age  field
  7514.         reaches its maximum value of MaxAge).
  7515.  
  7516.         If the adjacent router  goes  down,  retransmissions  may  occur
  7517.         until the adjacency is destroyed by OSPF's Hello Protocol.  When
  7518.         the adjacency is destroyed, the Link state  retransmission  list
  7519.         is cleared.
  7520.  
  7521.  
  7522.     13.7.  Receiving link state acknowledgments
  7523.  
  7524.         Many consistency checks have been made on a received Link  State
  7525.         Acknowledgment  packet  before it is handed to the flooding pro-
  7526.         cedure.  In particular, it has been associated with a particular
  7527.         neighbor.   If this neighbor is in a lesser state than Exchange,
  7528.         the packet is discarded.
  7529.  
  7530.         Otherwise, for each acknowledgment in the packet, the  following
  7531.         steps are performed:
  7532.  
  7533.  
  7534.         o   Does the advertisement acknowledged have an instance on  the
  7535.             Link  state  retransmission  list for the neighbor?  If not,
  7536.             examine the next acknowledgment.  Otherwise:
  7537.  
  7538.         o   If the acknowledgment is for the same instance that is  con-
  7539.             tained  on the list, remove the item from the list and exam-
  7540.             ine the next acknowledgment.  Otherwise:
  7541.  
  7542.         o   Log the questionable acknowledgment, and  examine  the  next
  7543.             one.
  7544.  
  7545.  
  7546. 14.  Aging The Link State Database
  7547.  
  7548.     Each link  state  advertisement  has  an  age  field.   The  age  is
  7549.     expressed  in  seconds.  An advertisement's age field is incremented
  7550.     while it is contained in a router's  database.   Also,  when  copied
  7551.     into a Link State Update Packet for flooding out a particular inter-
  7552.     face, the advertisement's age is incremented by InfTransDelay.
  7553.  
  7554.     An advertisement's age is never incremented past the  value  MaxAge.
  7555.     Advertisements  having  age MaxAge are not used in the routing table
  7556.     calculation.   As  a  router  ages  its  link  state  database,   an
  7557.  
  7558.  
  7559.  
  7560. [Moy]                                                         [Page 135]
  7561.  
  7562. Internet Draft               OSPF Version 2                November 1992
  7563.  
  7564.  
  7565.     advertisement's  age  may reach MaxAge.[18] At this time, the router
  7566.     must attempt to flush the advertisement  from  the  routing  domain.
  7567.     This  is  done simply by reflooding the MaxAge advertisement just as
  7568.     if it was a newly originated advertisement (see Section 13.3).
  7569.  
  7570.     When a Database summary  list  for  a  newly  adjacent  neighbor  is
  7571.     formed, any MaxAge advertisements present in the link state database
  7572.     are added to the neighbor's Link state retransmission  list  instead
  7573.     of  the neighbor's Database summary list.  See Section 10.3 for more
  7574.     details.
  7575.  
  7576.     A MaxAge advertisement is removed entirely from  the  router's  link
  7577.     state  database  when  a)  it is no longer contained on any neighbor
  7578.     Link state retransmission lists and b) none of the  router's  neigh-
  7579.     bors are in states Exchange or Loading.
  7580.  
  7581.     When,  in  the  process  of  aging  the  link  state  database,   an
  7582.     advertisement's age hits a multiple of CheckAge, its checksum should
  7583.     be verified.  If the checksum is  incorrect,  a  program  or  memory
  7584.     error  has  been  detected,  and at the very least the router itself
  7585.     should be restarted.
  7586.  
  7587.  
  7588.     14.1.  Premature aging of advertisements
  7589.  
  7590.         A link state advertisement  can  be  flushed  from  the  routing
  7591.         domain  by  setting  its age to MaxAge and reflooding the adver-
  7592.         tisement.  This procedure follows the same course as flushing an
  7593.         advertisement  whose  age has naturally reached the value MaxAge
  7594.         (see Section 14).  In particular, the  MaxAge  advertisement  is
  7595.         removed  from  the router's link state database as soon as a) it
  7596.         is no longer contained on any neighbor Link state retransmission
  7597.         lists  and  b)  none  of  the  router's  neighbors are in states
  7598.         Exchange or Loading.  We call the setting of an  advertisement's
  7599.         age to MaxAge premature aging.
  7600.  
  7601.         Premature aging is used when it is time  for  a  self-originated
  7602.         advertisement's  sequence  number field to wrap.  At this point,
  7603.         the current advertisement instance (having LS sequence number of
  7604.         0x7fffffff)  must be prematurely aged and flushed from the rout-
  7605.         ing domain before a new instance with sequence number 0x80000001
  7606.         can be originated.  See Section 12.1.6 for more information.
  7607.  
  7608.         Premature aging can also be used when, for example, one  of  the
  7609.         router's  previously  advertised  external  routes  is no longer
  7610.         reachable.  In this  circumstance,  the  router  can  flush  its
  7611.         external  advertisement  from  the  routing domain via premature
  7612.         aging.  This procedure is preferable to the  alternative,  which
  7613.  
  7614.  
  7615.  
  7616. [Moy]                                                         [Page 136]
  7617.  
  7618. Internet Draft               OSPF Version 2                November 1992
  7619.  
  7620.  
  7621.         is to originate a new advertisement for the destination specify-
  7622.         ing a metric of LSInfinity.
  7623.  
  7624.         A router may only prematurely age its own (self-originated) link
  7625.         state  advertisements.   These are the link state advertisements
  7626.         having the router's own OSPF Router ID in the Advertising Router
  7627.         field.
  7628.  
  7629.  
  7630. 15.  Virtual Links
  7631.  
  7632.     The single backbone area (Area ID = 0) cannot  be  disconnected,  or
  7633.     some  areas  of  the  Autonomous System will become unreachable.  To
  7634.     establish/maintain connectivity of the backbone, virtual  links  can
  7635.     be  configured  through  non-backbone areas.  Virtual links serve to
  7636.     connect separate components of the backbone.  The two endpoints of a
  7637.     virtual link are area border routers.  The virtual link must be con-
  7638.     figured in both routers.   The  configuration  information  in  each
  7639.     router consists of the other virtual endpoint (the other area border
  7640.     router), and the non-backbone area the two routers  have  in  common
  7641.     (called  the  transit  area).   Virtual  links  cannot be configured
  7642.     through stub areas (see Section 3.6).
  7643.  
  7644.     The virtual link is treated as if it were  an  unnumbered  point-to-
  7645.     point  network  (belonging  to  the  backbone)  joining the two area
  7646.     border routers.  An attempt is made to establish an  adjacency  over
  7647.     the  virtual  link.  When this adjacency is established, the virtual
  7648.     link will be included in backbone router links  advertisements,  and
  7649.     OSPF  packets  pertaining  to  the  backbone area will flow over the
  7650.     adjacency.  Such an adjacency has been referred  to  as  a  "virtual
  7651.     adjacency".
  7652.  
  7653.     In each endpoint router, the cost and viability of the virtual  link
  7654.     is  discovered  by  examining  the routing table entry for the other
  7655.     endpoint router.  (The entry's associated area must be  the  config-
  7656.     ured transit area).  Actually, there may be a separate routing table
  7657.     entry for each Type of Service.  These are called the virtual link's
  7658.     corresponding  routing table entries.  The Interface Up event occurs
  7659.     for a virtual link when its corresponding TOS 0 routing table  entry
  7660.     becomes reachable.  Conversely, the Interface Down event occurs when
  7661.     its TOS 0 routing table  entry  becomes  unreachable.[19]  In  other
  7662.     words,  the  virtual link's viability is determined by the existence
  7663.     of an intra-area path, through the transit  area,  between  the  two
  7664.     endpoints.   Note that a virtual link whose underlying path has cost
  7665.     greater than hexadecimal 0xffff (the maximum size  of  an  interface
  7666.     cost  in a router links advertisement) should be considered inopera-
  7667.     tional (i.e., treated the same as if the path did not exist).
  7668.  
  7669.  
  7670.  
  7671.  
  7672. [Moy]                                                         [Page 137]
  7673.  
  7674. Internet Draft               OSPF Version 2                November 1992
  7675.  
  7676.  
  7677.     The other details concerning virtual links are as follows:
  7678.  
  7679.     o   AS external links are NEVER flooded  over  virtual  adjacencies.
  7680.         This  would be duplication of effort, since the same AS external
  7681.         links are already flooded throughout the virtual link's  transit
  7682.         area.  For this same reason, AS external link advertisements are
  7683.         not summarized over  virtual  adjacencies  during  the  database
  7684.         exchange process.
  7685.  
  7686.     o   The cost of a virtual link is NOT configured.  It is defined  to
  7687.         be the cost of the intra-area path between the two defining area
  7688.         border  routers.   This  cost  appears  in  the  virtual  link's
  7689.         corresponding  routing  table entry.  When the cost of a virtual
  7690.         link changes, a new router links advertisement  should  be  ori-
  7691.         ginated for the backbone area.
  7692.  
  7693.     o   Just as the virtual link's cost and viability are determined  by
  7694.         the  routing  table  build  process (through construction of the
  7695.         routing table entry for the  other  endpoint),  so  are  the  IP
  7696.         interface  address  for  the  virtual  interface and the virtual
  7697.         neighbor's IP address.  These are  used  when  sending  protocol
  7698.         packets  over  the virtual link. Note that when one (or both) of
  7699.         the virtual link endpoints connect to the transit  area  via  an
  7700.         unnumbered  point-to-point  link, it may be impossible to calcu-
  7701.         late either the virtual interface's IP address and/or  the  vir-
  7702.         tual neighbor's IP address, causing the virtual link to fail.
  7703.  
  7704.     o   In each endpoint's router links advertisement for the  backbone,
  7705.         the  virtual  link  is represented as a link having link type 4,
  7706.         Link ID set to the virtual neighbor's OSPF Router  ID  and  Link
  7707.         Data  set  to  the  virtual interface's IP address.  See Section
  7708.         12.4.1 for more information. Note that it may be the  case  that
  7709.         there  is  a  TOS 0 path, but no non-zero TOS paths, between the
  7710.         two endpoint routers.  In this case, both routers must revert to
  7711.         being  non-TOS-capable,  clearing the T-bit in the Options field
  7712.         of their backbone router links advertisements.
  7713.  
  7714.     o   When virtual links are configured for the backbone,  information
  7715.         concerning  backbone  networks  should  not  be condensed before
  7716.         being summarized for the transit areas.  In  other  words,  each
  7717.         backbone  network should be advertised into the transit areas in
  7718.         a  separate  summary  link  advertisement,  regardless  of   the
  7719.         backbone's  configured  area address ranges.  See Section 12.4.3
  7720.         for more information.
  7721.  
  7722.     o   The time between link state  retransmissions,  RxmtInterval,  is
  7723.         configured  for  a  virtual  link.  This should be well over the
  7724.         expected round-trip delay between the two routers.  This may  be
  7725.  
  7726.  
  7727.  
  7728. [Moy]                                                         [Page 138]
  7729.  
  7730. Internet Draft               OSPF Version 2                November 1992
  7731.  
  7732.  
  7733.         hard to estimate for a virtual link.  It is better to err on the
  7734.         side of making it too large.
  7735.  
  7736.  
  7737. 16.  Calculation Of The Routing Table
  7738.  
  7739.     This section details the OSPF routing table calculation.  Using  its
  7740.     attached  areas'  link  state  databases as input, a router runs the
  7741.     following algorithm, building its routing table step  by  step.   At
  7742.     each  step,  the  router  must  access individual pieces of the link
  7743.     state databases (e.g., a router links advertisement originated by  a
  7744.     certain  router).   This  access is performed by the lookup function
  7745.     discussed in Section 12.2.  The lookup process  may  return  a  link
  7746.     state advertisement whose LS age is equal to MaxAge.  Such an adver-
  7747.     tisement should not be used in the routing table calculation, and is
  7748.     treated just as if the lookup process had failed.
  7749.  
  7750.     The OSPF routing table's organization is explained  in  Section  11.
  7751.     Two  examples  of  the  routing table build process are presented in
  7752.     Sections 11.2 and 11.3.  This process can be broken into the follow-
  7753.     ing steps:
  7754.  
  7755.  
  7756.     (1) The present routing table is invalidated.  The routing table  is
  7757.         built  again  from  scratch.   The old routing table is saved so
  7758.         that changes in routing table entries can be identified.
  7759.  
  7760.     (2) The intra-area routes are calculated by building  the  shortest-
  7761.         path  tree  for  each attached area.  In particular, all routing
  7762.         table entries whose Destination type is "area border router" are
  7763.         calculated  in  this step.  This step is described in two parts.
  7764.         At first the tree is constructed by only considering those links
  7765.         between  routers  and  transit networks.  Then the stub networks
  7766.         are incorporated into the tree. During the area's  shortest-path
  7767.         tree  calculation,  the area's Transit capability is also calcu-
  7768.         lated for later use in Step 4.
  7769.  
  7770.     (3) The inter-area routes are  calculated,  through  examination  of
  7771.         summary  link advertisements.  If the router is attached to mul-
  7772.         tiple areas (i.e., it is an area border router),  only  backbone
  7773.         summary link advertisements are examined.
  7774.  
  7775.     (4) In area border routers connecting to one or more  transit  areas
  7776.         (i.e, non-backbone areas whose Transit capability is found to be
  7777.         TRUE), the transit areas' summary  links  are  examined  to  see
  7778.         whether  better  paths  exist  using the transit areas than were
  7779.         found in Steps 2-3 above.
  7780.  
  7781.  
  7782.  
  7783.  
  7784. [Moy]                                                         [Page 139]
  7785.  
  7786. Internet Draft               OSPF Version 2                November 1992
  7787.  
  7788.  
  7789.     (5) Routes to external destinations are calculated, through examina-
  7790.         tion of AS external link advertisements.  The location of the AS
  7791.         boundary routers (which originate the AS  external  link  adver-
  7792.         tisements) has been determined in steps 2-4.
  7793.  
  7794.  
  7795.     Steps 2-5 are explained in further detail below.   The  explanations
  7796.     describe  the calculations for TOS 0 only.  It may also be necessary
  7797.     to perform each step (separately)  for  each  of  the  non-zero  TOS
  7798.     values.[20] For more information concerning the building of non-zero
  7799.     TOS routes see Section 16.9.
  7800.  
  7801.     Changes made to routing table entries as a result of these  calcula-
  7802.     tions  can  cause  the  OSPF  protocol to take further actions.  For
  7803.     example, a change to an intra-area route will cause an  area  border
  7804.     router  to  originate  new  summary link advertisements (see Section
  7805.     12.4).  See Section 16.7 for a complete list of  the  OSPF  protocol
  7806.     actions resulting from routing table table changes.
  7807.  
  7808.  
  7809.     16.1.  Calculating the shortest-path tree for an area
  7810.  
  7811.         This calculation yields the set of intra-area routes  associated
  7812.         with an area (called hereafter Area A).  A router calculates the
  7813.         shortest-path tree using itself as the root.[21]  The  formation
  7814.         of  the  shortest  path tree is done here in two stages.  In the
  7815.         first stage, only links between routers and transit networks are
  7816.         considered.  Using the Dijkstra algorithm, a tree is formed from
  7817.         this subset of the link state database.  In  the  second  stage,
  7818.         leaves  are  added  to the tree by considering the links to stub
  7819.         networks.
  7820.  
  7821.         The procedure will be explained using the graph terminology that
  7822.         was  introduced in Section 2.  The area's link state database is
  7823.         represented as a  directed  graph.   The  graph's  vertices  are
  7824.         routers, transit networks and stub networks.  The first stage of
  7825.         the procedure concerns only the transit  vertices  (routers  and
  7826.         transit  networks)  and  their connecting links.  Throughout the
  7827.         shortest path calculation, the following data is also associated
  7828.         with each transit vertex:
  7829.  
  7830.  
  7831.         Vertex (node) ID
  7832.             A 32-bit number uniquely identifying the vertex.  For router
  7833.             vertices  this is the OSPF Router ID.  For network vertices,
  7834.             this is the IP address of the network's Designated Router.
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840. [Moy]                                                         [Page 140]
  7841.  
  7842. Internet Draft               OSPF Version 2                November 1992
  7843.  
  7844.  
  7845.         A link state advertisement
  7846.             Each transit vertex has an associated link state  advertise-
  7847.             ment.   For  router  vertices, this is a router links adver-
  7848.             tisement.  For transit networks, this  is  a  network  links
  7849.             advertisement (which is actually originated by the network's
  7850.             Designated Router).  In any case, the  advertisement's  Link
  7851.             State ID is always equal to the above Vertex ID.
  7852.  
  7853.         List of next hops
  7854.             The list of next hops for the current set of shortest  paths
  7855.             from  the  root to this vertex.  There can be multiple shor-
  7856.             test paths due to the equal-cost multipath capability.  Each
  7857.             next hop indicates the outgoing router interface to use when
  7858.             forwarding traffic to the destination.  On multi-access net-
  7859.             works, the next hop also includes the IP address of the next
  7860.             router (if any) in the path towards the destination.
  7861.  
  7862.         Distance from root
  7863.             The link state cost of the current  set  of  shortest  paths
  7864.             from  the root to the vertex.  The link state cost of a path
  7865.             is calculated as the sum of the costs of the path's  consti-
  7866.             tuent links (as advertised in router links and network links
  7867.             advertisements).  One path is  said  to  be  "shorter"  than
  7868.             another if it has a smaller link state cost.
  7869.  
  7870.  
  7871.         The first stage of the procedure (i.e., the Dijkstra  algorithm)
  7872.         can now be summarized as follows. At each iteration of the algo-
  7873.         rithm, there is a list of candidate vertices.   Paths  from  the
  7874.         root  to these vertices have been found, but not necessarily the
  7875.         shortest ones.  However, the paths to the candidate vertex  that
  7876.         is  closest to the root are guaranteed to be shortest; this ver-
  7877.         tex is added to the shortest-path tree, removed from the  candi-
  7878.         date  list,  and its adjacent vertices are examined for possible
  7879.         addition to/modification of the candidate list.   The  algorithm
  7880.         then  iterates  again.   It  terminates  when the candidate list
  7881.         becomes empty.
  7882.  
  7883.         The  following  steps  describe  the  first  stage  in   detail.
  7884.         Remember  that  we are computing the shortest path tree for Area
  7885.         A.  All references to link state database lookup below are  from
  7886.         Area A's database.
  7887.  
  7888.  
  7889.         (1) Initialize the algorithm's data structures.  Clear the  list
  7890.             of candidate vertices.  Initialize the shortest-path tree to
  7891.             only the root (which is the router doing  the  calculation).
  7892.             Set Area A's Transit Capability to FALSE.
  7893.  
  7894.  
  7895.  
  7896. [Moy]                                                         [Page 141]
  7897.  
  7898. Internet Draft               OSPF Version 2                November 1992
  7899.  
  7900.  
  7901.         (2) Call the vertex just added to the tree  vertex  V.   Examine
  7902.             the link state advertisement associated with vertex V.  This
  7903.             is a lookup in the Area A's link state database based on the
  7904.             Vertex ID.  If this is a router links advertisement, and bit
  7905.             V of the router links advertisement (see Section  A.4.2)  is
  7906.             set,  set Area A's Transit capability to TRUE.  In any case,
  7907.             each link described by the advertisement gives the  cost  to
  7908.             an  adjacent vertex.  For each described link, (say it joins
  7909.             vertex V to vertex W):
  7910.  
  7911.             (a) If this is a link to a stub network,  examine  the  next
  7912.                 link  in V's advertisement.  Links to stub networks will
  7913.                 be considered in the second stage of the  shortest  path
  7914.                 calculation.
  7915.  
  7916.             (b) Otherwise, W is a transit vertex (router or transit net-
  7917.                 work).   Look up the vertex W's link state advertisement
  7918.                 (router links or network links) in Area A's  link  state
  7919.                 database.   If  the advertisement does not exist, or its
  7920.                 age is equal to MaxAge, or it does not have a link  back
  7921.                 to vertex V, examine the next link in V's advertisement.
  7922.                 Both ends of a link must advertise the  link  before  it
  7923.                 will be used for data traffic.[22]
  7924.  
  7925.             (c) If vertex W is already on the shortest-path tree,  exam-
  7926.                 ine the next link in the advertisement.
  7927.  
  7928.             (d) Calculate the link state cost D of  the  resulting  path
  7929.                 from the root to vertex W.  D is equal to the sum of the
  7930.                 link state cost of  the  (already  calculated)  shortest
  7931.                 path  to  vertex  V  and the advertised cost of the link
  7932.                 between vertices V and W.  If D is:
  7933.  
  7934.                 o   Greater than the value that already appears for ver-
  7935.                     tex  W  on the candidate list, then examine the next
  7936.                     link.
  7937.  
  7938.                 o   Equal to the value that appears for vertex W on  the
  7939.                     the  candidate  list, calculate the set of next hops
  7940.                     that result from using the advertised  link.   Input
  7941.                     to  this calculation is the destination (W), and its
  7942.                     parent (V).  This calculation is  shown  in  Section
  7943.                     16.1.1.   This  set  of  hops should be added to the
  7944.                     next hop values that appear for W on  the  candidate
  7945.                     list.
  7946.  
  7947.                 o   Less than the value that appears for vertex W on the
  7948.                     the  candidate  list, or if W does not yet appear on
  7949.  
  7950.  
  7951.  
  7952. [Moy]                                                         [Page 142]
  7953.  
  7954. Internet Draft               OSPF Version 2                November 1992
  7955.  
  7956.  
  7957.                     the candidate list, then set the entry for W on  the
  7958.                     candidate  list to indicate a distance of D from the
  7959.                     root.  Also calculate the list  of  next  hops  that
  7960.                     result  from  using the advertised link, setting the
  7961.                     next hop values for W  accordingly.   The  next  hop
  7962.                     calculation is described in Section 16.1.1; it takes
  7963.                     as input the destination (W) and its parent (V).
  7964.  
  7965.         (3) If at this step the candidate list is empty,  the  shortest-
  7966.             path  tree  (of  transit vertices) has been completely built
  7967.             and this stage  of  the  algorithm  terminates.   Otherwise,
  7968.             choose  the  vertex  belonging to the candidate list that is
  7969.             closest to the root, and add it to  the  shortest-path  tree
  7970.             (removing  it  from the candidate list in the process). Note
  7971.             that when there is a choice of vertices closest to the root,
  7972.             network  vertices  must  be chosen before router vertices in
  7973.             order to necessarily find all equal-cost paths. This is con-
  7974.             sistent  with  the  tie-breakers that were introduced in the
  7975.             modified Dijkstra algorithm in [MOSPF].
  7976.  
  7977.         (4) Possibly modify the routing table.  For those routing  table
  7978.             entries modified, the associated area will be set to Area A,
  7979.             the path type will be set to intra-area, and the  cost  will
  7980.             be  set  to  the newly discovered shortest path's calculated
  7981.             distance.
  7982.  
  7983.             If the newly added vertex is an area border router (call  it
  7984.             ABR),  a routing table entry is added whose destination type
  7985.             is "area border router". The  Options  field  found  in  the
  7986.             associated  router  links  advertisement  is copied into the
  7987.             routing table entry's Optional  capabilities  field.  If  in
  7988.             addition  ABR  is  an  endpoint of a configured virtual link
  7989.             that uses Area A as its transit area: the  virtual  link  is
  7990.             declared  up, the IP address of the virtual interface is set
  7991.             to the IP address of the outgoing interface calculated above
  7992.             for ABR, and the virtual neighbor's IP address is set to the
  7993.             ABR interface  address  (contained  in  ABR's  router  links
  7994.             advertisement)   that   points  back  to  the  root  of  the
  7995.             shortest-path tree; equivalently, this is the interface that
  7996.             points back to ABR's parent vertex on the shortest-path tree
  7997.             (similar to the calculation in Section 16.1.1).
  7998.  
  7999.             If the newly added vertex is  an  AS  boundary  router,  the
  8000.             routing  table  entry  of  type "AS boundary router" for the
  8001.             destination is located.  Since routers can  belong  to  more
  8002.             than  one  area,  it is possible that several sets of intra-
  8003.             area paths exist to the AS boundary router, each set using a
  8004.             different  area.   However, the AS boundary router's routing
  8005.  
  8006.  
  8007.  
  8008. [Moy]                                                         [Page 143]
  8009.  
  8010. Internet Draft               OSPF Version 2                November 1992
  8011.  
  8012.  
  8013.             table entry must indicate a set of  paths  which  utilize  a
  8014.             single area.  The area leading to the routing table entry is
  8015.             selected as follows: A set of  intra-area  paths  having  no
  8016.             virtual  next  hops is always preferred over a set of intra-
  8017.             area paths in which some virtual next hops appear[23] ;  all
  8018.             other  things being equal the set of paths having lower cost
  8019.             is preferred.  Note that whenever an  AS  boundary  router's
  8020.             routing  table entry is added/modified, the Options found in
  8021.             the associated router links advertisement is copied into the
  8022.             routing table entry's Optional capabilities field.
  8023.  
  8024.             If the newly added vertex is a transit network, the  routing
  8025.             table  entry for the network is located.  The entry's desti-
  8026.             nation ID is the IP network number, which can be obtained by
  8027.             masking  the  Vertex  ID (Link State ID) with its associated
  8028.             subnet mask (found in the associated  network  links  adver-
  8029.             tisement).  If the routing table entry already exists (i.e.,
  8030.             there is already an  intra-area  route  to  the  destination
  8031.             installed  in  the  routing  table),  multiple vertices have
  8032.             mapped to the same IP network.  For example, this can  occur
  8033.             when  a new Designated Router is being established.  In this
  8034.             case, the current routing table entry should be  overwritten
  8035.             if and only if the newly found path is just as short and the
  8036.             current routing  table  entry's  Link  State  Origin  has  a
  8037.             smaller  Link  State  ID  than  the newly added vertex' link
  8038.             state advertisement.
  8039.  
  8040.             If there is no routing table  entry  for  the  network  (the
  8041.             usual case), a routing table entry for the IP network should
  8042.             be added.  The  routing  table  entry's  Link  State  origin
  8043.             should  be  set to the newly added vertex' link state adver-
  8044.             tisement.
  8045.  
  8046.         (5) Iterate the algorithm by returning to Step 2.
  8047.  
  8048.  
  8049.         The stub networks are added  to  the  tree  in  the  procedure's
  8050.         second  stage.   In  this  stage,  all router vertices are again
  8051.         examined.  Those that have been determined to be unreachable  in
  8052.         the  above first phase are discarded.  For each reachable router
  8053.         vertex (call it V), the associated router links advertisement is
  8054.         found  in  the  link  state  database.   Each  stub network link
  8055.         appearing in the advertisement is then examined, and the follow-
  8056.         ing steps are executed:
  8057.  
  8058.  
  8059.         (1) Calculate the distance D of stub network from the  root.   D
  8060.             is  equal to the distance from the root to the router vertex
  8061.  
  8062.  
  8063.  
  8064. [Moy]                                                         [Page 144]
  8065.  
  8066. Internet Draft               OSPF Version 2                November 1992
  8067.  
  8068.  
  8069.             (calculated in stage 1), plus the stub network link's adver-
  8070.             tised  cost.  Compare this distance to the current best cost
  8071.             to the stub  network.   This  is  done  by  looking  up  the
  8072.             network's  current  routing  table entry.  If the calculated
  8073.             distance D is larger, go on to examine the next stub network
  8074.             link in the advertisement.
  8075.  
  8076.         (2) If this step is reached, the stub  network's  routing  table
  8077.             entry  must be updated.  Calculate the set of next hops that
  8078.             would result from using the stub network link.  This  calcu-
  8079.             lation is shown in Section 16.1.1; input to this calculation
  8080.             is the destination (the stub network) and the parent  vertex
  8081.             (the  router  vertex).  If the distance D is the same as the
  8082.             current routing table cost, simply add this set of next hops
  8083.             to  the  routing  table  entry's list of next hops.  In this
  8084.             case, the routing table already has a Link State origin.  If
  8085.             this Link State origin is a router links advertisement whose
  8086.             Link State ID is smaller than V's Router ID, reset the  Link
  8087.             State origin to V's router links advertisement.
  8088.  
  8089.             Otherwise  D  is  smaller  than  the  routing  table   cost.
  8090.             Overwrite  the  current  routing  table entry by setting the
  8091.             routing table entry's cost to D, and by setting the  entry's
  8092.             list  of  next  hops  to  the newly calculated set.  Set the
  8093.             routing table entry's Link State origin to V's router  links
  8094.             advertisement.   Then go on to examine the next stub network
  8095.             link.
  8096.  
  8097.  
  8098.         For all routing  table  entries  added/modified  in  the  second
  8099.         stage,  the  associated  area will be set to Area A and the path
  8100.         type will be set to intra-area.   When  the  list  of  reachable
  8101.         router  links  is  exhausted, the second stage is completed.  At
  8102.         this time, all intra-area routes associated  with  Area  A  have
  8103.         been determined.
  8104.  
  8105.         The specification does not require  that  the  above  two  stage
  8106.         method be used to calculate the shortest path tree.  However, if
  8107.         another algorithm is used, an identical tree must  be  produced.
  8108.         For  this  reason,  it  is  important to note that links between
  8109.         transit vertices must be bidirectional in ordered to be included
  8110.         in  the above tree.  It should also be mentioned that algorithms
  8111.         exist for incrementally updating  the  shortest-path  tree  (see
  8112.         [BBN]).
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120. [Moy]                                                         [Page 145]
  8121.  
  8122. Internet Draft               OSPF Version 2                November 1992
  8123.  
  8124.  
  8125.         16.1.1.  The next hop calculation
  8126.  
  8127.             This section explains how to calculate the  current  set  of
  8128.             next  hops to use for a destination.  Each next hop consists
  8129.             of the outgoing interface to use in  forwarding  packets  to
  8130.             the  destination together with the next hop router (if any).
  8131.             The next hop calculation is invoked each time a shorter path
  8132.             to the destination is discovered.  This can happen in either
  8133.             stage of the shortest-path  tree  calculation  (see  Section
  8134.             16.1).   In  stage 1 of the shortest-path tree calculation a
  8135.             shorter path is found as the destination  is  added  to  the
  8136.             candidate  list, or when the destination's entry on the can-
  8137.             didate list is modified (Step 2d of Stage 1).  In stage 2  a
  8138.             shorter path is discovered each time the destination's rout-
  8139.             ing table entry is modified (Step 2 of Stage 2).
  8140.  
  8141.             The set of next hops to  use  for  the  destination  may  be
  8142.             recalculated  several  times  during  the shortest-path tree
  8143.             calculation, as shorter and shorter  paths  are  discovered.
  8144.             In  the  end,  the  destination's  routing  table entry will
  8145.             always reflect the next hops  resulting  from  the  absolute
  8146.             shortest path(s).
  8147.  
  8148.             Input to the next hop calculation is a) the destination  and
  8149.             b)  its parent in the current shortest path between the root
  8150.             (the calculating router) and the destination.  The parent is
  8151.             always  a transit vertex (i.e., always a router or a transit
  8152.             network).
  8153.  
  8154.             If there is at least one intervening router in  the  current
  8155.             shortest path between the destination and the root, the des-
  8156.             tination simply inherits the  set  of  next  hops  from  the
  8157.             parent.  Otherwise, there are two cases.  In the first case,
  8158.             the parent  vertex  is  the  root  (the  calculating  router
  8159.             itself).   This  means  that  the  destination  is  either a
  8160.             directly connected network  or  directly  connected  router.
  8161.             The  next hop in this case is simply the OSPF interface con-
  8162.             necting  to  the  network/router;  no  next  hop  router  is
  8163.             required. If the connecting OSPF interface in this case is a
  8164.             virtual link, the setting of the next hop should be deferred
  8165.             until the calculation in Section 16.3.
  8166.  
  8167.             In the second case, the parent  vertex  is  a  network  that
  8168.             directly  connects the calculating router to the destination
  8169.             router.  The list of next hops is then determined by examin-
  8170.             ing  the destination's router links advertisement.  For each
  8171.             link in the advertisement that points  back  to  the  parent
  8172.             network,  the link's Link Data field provides the IP address
  8173.  
  8174.  
  8175.  
  8176. [Moy]                                                         [Page 146]
  8177.  
  8178. Internet Draft               OSPF Version 2                November 1992
  8179.  
  8180.  
  8181.             of a next hop router.  The outgoing  interface  to  use  can
  8182.             then  be  derived from the next hop IP address (or it can be
  8183.             inherited from the parent network).
  8184.  
  8185.  
  8186.     16.2.  Calculating the inter-area routes
  8187.  
  8188.         The inter-area routes are calculated by examining  summary  link
  8189.         advertisements.   If the router has active attachments to multi-
  8190.         ple areas, only backbone summary link advertisements  are  exam-
  8191.         ined.   Routers  attached  to  a single area examine that area's
  8192.         summary links.  In either case, the summary links examined below
  8193.         are  all  part  of  a single area's link state database (call it
  8194.         Area A).
  8195.  
  8196.         Summary link advertisements are originated by  the  area  border
  8197.         routers.   Each  summary  link  advertisement  in Area A is con-
  8198.         sidered in turn.  Remember that the destination described  by  a
  8199.         summary  link  advertisement is either a network (type 3 summary
  8200.         link advertisements) or an AS boundary router  (type  4  summary
  8201.         link advertisements).  For each summary link advertisement:
  8202.  
  8203.  
  8204.         (1) If the cost specified by the advertisement is LSInfinity, or
  8205.             if the advertisement's LS age is equal to MaxAge, then exam-
  8206.             ine the the next advertisement.
  8207.  
  8208.         (2) If the  advertisement  was  originated  by  the  calculating
  8209.             router itself, examine the next advertisement.
  8210.  
  8211.         (3) If the collection of destinations described by  the  summary
  8212.             link  falls into one of the router's configured area address
  8213.             ranges (see Section 3.5) and  the  particular  area  address
  8214.             range is active, the summary link should be ignored.  Active
  8215.             means that there are one or more  reachable  (by  intra-area
  8216.             paths)  networks contained in the area range.  In this case,
  8217.             all addresses in the area range are  assumed  to  be  either
  8218.             reachable via intra-area paths, or else to be unreachable by
  8219.             any other means.
  8220.  
  8221.         (4) Else, call the destination described by the advertisement  N
  8222.             (for  type 3 summary links, N's address is obtained by mask-
  8223.             ing   the   advertisement's   Link   State   ID   with   the
  8224.             network/subnet  mask contained in the body of the advertise-
  8225.             ment), and the area border originating the advertisement BR.
  8226.             Look up the routing table entry for BR having A as its asso-
  8227.             ciated area.  If no such entry exists for router  BR  (i.e.,
  8228.             BR   is  unreachable  in  Area  A),  do  nothing  with  this
  8229.  
  8230.  
  8231.  
  8232. [Moy]                                                         [Page 147]
  8233.  
  8234. Internet Draft               OSPF Version 2                November 1992
  8235.  
  8236.  
  8237.             advertisement and consider the next in the list.  Else, this
  8238.             advertisement describes an inter-area path to destination N,
  8239.             whose cost is the distance to BR plus the cost specified  in
  8240.             the  advertisement.  Call  the  cost of this inter-area path
  8241.             IAC.
  8242.  
  8243.         (5) Next, look up the routing table entry for the destination N.
  8244.             (The  entry's Destination type is either Network or AS boun-
  8245.             dary router.)  If no entry exists for N or  if  the  entry's
  8246.             path  type  is "AS external", install the inter-area path to
  8247.             N, with associated area A, cost IAC, next hop equal  to  the
  8248.             list of next hops to router BR, and advertising router equal
  8249.             to BR.
  8250.  
  8251.         (6) Else, if the paths  present  in  the  table  are  intra-area
  8252.             paths,  do  nothing with the advertisement (intra-area paths
  8253.             are always preferred).
  8254.  
  8255.         (7) Else, the paths  present  in  the  routing  table  are  also
  8256.             inter-area  paths.  Install the new path through BR if it is
  8257.             cheaper, overriding the paths in the routing table.   Other-
  8258.             wise,  if  the new path is the same cost, add it to the list
  8259.             of paths that appear in the routing table entry.
  8260.  
  8261.  
  8262.     16.3.  Examining transit areas' summary links
  8263.  
  8264.         This step is only performed by area border routers  attached  to
  8265.         one  or  more  transit areas. Transit areas are those areas sup-
  8266.         porting one or more  virtual  links;  their  Transit  Capability
  8267.         parameter  has  been set to TRUE in Step 2 of the Dijkstra algo-
  8268.         rithm (see Section 16.1). They are the only  non-backbone  areas
  8269.         that  can  carry  data  traffic that neither originates nor ter-
  8270.         minates in the area itself.
  8271.  
  8272.         The purpose of the calculation below is to examine  the  transit
  8273.         areas  to  see  whether  they provide any better (shorter) paths
  8274.         than the paths previously calculated in Sections 16.1 and  16.2.
  8275.         Any   paths  found  that  are  better  or  equal  to  previously
  8276.         discovered paths are installed in the routing table.
  8277.  
  8278.         The calculation proceeds as follows. All the transit areas' sum-
  8279.         mary  link  advertisements are examined in turn.  Each such sum-
  8280.         mary link describes a route through a transit Area A to  a  Net-
  8281.         work  N  (N's address is obtained by masking the advertisement's
  8282.         Link State ID with the network/subnet mask contained in the body
  8283.         of  the  advertisement) or in the case of a type 4 summary link,
  8284.         to an AS boundary router N. Suppose also that the  summary  link
  8285.  
  8286.  
  8287.  
  8288. [Moy]                                                         [Page 148]
  8289.  
  8290. Internet Draft               OSPF Version 2                November 1992
  8291.  
  8292.  
  8293.         was originated by an area border router BR.
  8294.  
  8295.         (1) If the cost advertised by the summary link is LSInfinity, or
  8296.             if the advertisement's LS age is equal to MaxAge, then exam-
  8297.             ine the next advertisement.
  8298.  
  8299.         (2) If the summary link was originated by the calculating router
  8300.             itself, examine the next advertisement.
  8301.  
  8302.         (3) Look up the routing table entry for N. If it does not exist,
  8303.             or if the route type is other than intra-area or inter-area,
  8304.             or if the area associated with the routing  table  entry  is
  8305.             not  the backbone area, then examine the next advertisement.
  8306.             In other  words,  this  calculation  only  updates  backbone
  8307.             Dijkstra  routes found in Section 16.1 and inter-area routes
  8308.             found in Section 16.2.
  8309.  
  8310.         (4) Look up the routing table entry for the  advertising  router
  8311.             BR associated with the Area A. If it is unreachable, examine
  8312.             the next advertisement. Otherwise, the cost to destination N
  8313.             is  the  sum  of the cost in BR's Area A routing table entry
  8314.             and the cost advertised in the advertisement. Call this cost
  8315.             IAC.
  8316.  
  8317.         (5) If this cost is less than the cost occurring in N's  routing
  8318.             table entry, overwrite N's list of next hops with those used
  8319.             for BR, and set N's routing table cost to IAC. Else, if  IAC
  8320.             is  the same as N's current cost, add BR's list of next hops
  8321.             to N's list of next hops. In any case, the  area  associated
  8322.             with  N's routing table entry must remain the backbone area,
  8323.             and the path type (either  intra-area  or  inter-area)  must
  8324.             also remain the same.
  8325.  
  8326.         It is important to note that the above calculation  never  makes
  8327.         unreachable destinations reachable, but instead just potentially
  8328.         finds better paths  to  already  reachable  destinations.  Also,
  8329.         unlike  Section  16.3  of  [RFC  1247],  the  above  calculation
  8330.         installs any better cost found into  the  routing  table  entry,
  8331.         from which it may be readvertised in summary link advertisements
  8332.         to other areas.
  8333.  
  8334.         As an example of the calculation, consider the Autonomous System
  8335.         pictured  in  Figure  17.   There  is a single non-backbone area
  8336.         (Area 1) that physically divides the backbone into two  separate
  8337.         pieces. To maintain connectivity of the backbone, a virtual link
  8338.         has been configured between routers RT1 and RT4.  On  the  right
  8339.         side of the figure, network N1 belongs to the backbone. The dot-
  8340.         ted lines indicate that  there  is  a  much  shorter  intra-area
  8341.  
  8342.  
  8343.  
  8344. [Moy]                                                         [Page 149]
  8345.  
  8346. Internet Draft               OSPF Version 2                November 1992
  8347.  
  8348.  
  8349.  
  8350.                       ........................
  8351.                       . Area 1 (transit)     .            +
  8352.                       .                      .            |
  8353.                       .      +---+1        1+---+100      |
  8354.                       .      |RT2|----------|RT4|=========|
  8355.                       .    1/+---+********* +---+         |
  8356.                       .    /*******          .            |
  8357.                       .  1/*Virtual          .            |
  8358.                    1+---+/*  Link            .         Net|work
  8359.              =======|RT1|*                   .            | N1
  8360.                     +---+\                   .            |
  8361.                       .   \                  .            |
  8362.                       .    \                 .            |
  8363.                       .    1\+---+1        1+---+20       |
  8364.                       .      |RT3|----------|RT5|=========|
  8365.                       .      +---+          +---+         |
  8366.                       .                      .            |
  8367.                       ........................            +
  8368.  
  8369.  
  8370.                     Figure 17: Routing through transit areas
  8371.  
  8372.         backbone path between router RT5 and network N1 (cost  20)  than
  8373.         there  is  between  router  RT4  and network N1 (cost 100). Both
  8374.         router RT4 and router RT5 will inject  summary  link  advertise-
  8375.         ments for network N1 into Area 1.
  8376.  
  8377.         After the shortest-path tree has been calculated for  the  back-
  8378.         bone  in Section 16.1, router RT1 (left end of the virtual link)
  8379.         will have calculated a path through  router  RT4  for  all  data
  8380.         traffic destined for network N1. However, since router RT5 is so
  8381.         much closer to network N1, all routers internal to Area 1 (e.g.,
  8382.         routers  RT2  and  RT3)  will  forward  their network N1 traffic
  8383.         towards router RT5, instead of RT4. And indeed, after  examining
  8384.         Area 1's summary links by the above calculation, router RT1 will
  8385.         also forward network N1 traffic towards RT5. Note that  in  this
  8386.         example  the  virtual link enables network N1 traffic to be for-
  8387.         warded through the transit Area 1, but the actual path the  data
  8388.         traffic takes does not follow the virtual link.  In other words,
  8389.         virtual links allow transit traffic to be forwarded  through  an
  8390.         area,  but do not dictate the precise path that the traffic will
  8391.         take.
  8392.  
  8393.     16.4.  Calculating AS external routes
  8394.  
  8395.         AS external routes are calculated by examining AS external  link
  8396.         advertisements.   Each of the AS external link advertisements is
  8397.  
  8398.  
  8399.  
  8400. [Moy]                                                         [Page 150]
  8401.  
  8402. Internet Draft               OSPF Version 2                November 1992
  8403.  
  8404.  
  8405.         considered in turn.  Most AS  external  advertisements  describe
  8406.         routes  to  specific IP destinations.  An AS external advertise-
  8407.         ment can also describe a default route for the Autonomous System
  8408.         (destination  =  DefaultDestination).  For each AS external link
  8409.         advertisement:
  8410.  
  8411.  
  8412.         (1) If the cost specified by the advertisement is LSInfinity, or
  8413.             if the advertisement's LS age is equal to MaxAge, then exam-
  8414.             ine the next advertisement.
  8415.  
  8416.         (2) If the  advertisement  was  originated  by  the  calculating
  8417.             router itself, examine the next advertisement.
  8418.  
  8419.         (3) Call the destination described by the advertisement N.   N's
  8420.             address  is  obtained  by  masking  the advertisement's Link
  8421.             State ID with the network/subnet mask contained in the  body
  8422.             of  the  advertisement.  Look up the routing table entry for
  8423.             the AS boundary router (ASBR) that originated the advertise-
  8424.             ment.  If  no  entry  exists  for router ASBR (i.e., ASBR is
  8425.             unreachable), do nothing with this  advertisement  and  con-
  8426.             sider the next in the list.
  8427.  
  8428.             Else, this advertisement describes an AS  external  path  to
  8429.             destination  N.  Examine the forwarding address specified in
  8430.             the external advertisement.  This indicates the  IP  address
  8431.             to  which  packets  for the destination should be forwarded.
  8432.             If forwarding address is set to 0.0.0.0, packets  should  be
  8433.             sent  to the ASBR itself.  Otherwise, look up the forwarding
  8434.             address in the routing table.[24] An  intra-area  or  inter-
  8435.             area  path must exist to the forwarding address.  If no such
  8436.             path exists, do nothing with the advertisement and  consider
  8437.             the next in the list.
  8438.  
  8439.             Call the routing table distance to the forwarding address  X
  8440.             (when  the forwarding address is set to 0.0.0.0, this is the
  8441.             distance to the ASBR itself), and the cost specified in  the
  8442.             advertisement  Y.   X  is in terms of the link state metric,
  8443.             and Y is a Type 1 or 2 external metric.
  8444.  
  8445.         (4) Next, look up the routing table entry for the destination N.
  8446.             If no entry exists for N, install the AS external path to N,
  8447.             with next hop equal to the list of next hops to the forward-
  8448.             ing  address,  and advertising router equal to ASBR.  If the
  8449.             external metric type is 1, then the path-type is set to type
  8450.             1  external  and  the cost is equal to X+Y.  If the external
  8451.             metric type is 2, the the path-type is set to type 2  exter-
  8452.             nal,  the link state component of the route's cost is X, and
  8453.  
  8454.  
  8455.  
  8456. [Moy]                                                         [Page 151]
  8457.  
  8458. Internet Draft               OSPF Version 2                November 1992
  8459.  
  8460.  
  8461.             the Type 2 cost is Y.
  8462.  
  8463.         (5) Else, if the paths present in the table are not  type  1  or
  8464.             type  2  external  paths, do nothing (AS external paths have
  8465.             the lowest priority).
  8466.  
  8467.         (6) Otherwise, compare the cost of this new AS external path  to
  8468.             the  ones  present  in the table.  Type 1 external paths are
  8469.             always shorter than Type 2 external paths.  Type 1  external
  8470.             paths  are compared by looking at the sum of the distance to
  8471.             the forwarding address and  the  advertised  Type  1  metric
  8472.             (X+Y).  Type 2 external paths are compared by looking at the
  8473.             advertised Type 2 metrics, and then if necessary,  the  dis-
  8474.             tance to the forwarding addresses.
  8475.  
  8476.             If the new path is shorter, it replaces the present paths in
  8477.             the  routing table entry.  If the new path is the same cost,
  8478.             it is added to the routing table entry's list of paths.
  8479.  
  8480.  
  8481.     16.5.  Incremental updates --- summary links
  8482.  
  8483.         When a new summary link advertisement is  received,  it  is  not
  8484.         necessary  to  recalculate  the  entire routing table.  Call the
  8485.         destination described by the summary link advertisement  N  (N's
  8486.         address is obtained by masking the advertisement's Link State ID
  8487.         with the network/subnet mask contained in the body of the adver-
  8488.         tisement), and let Area A be the area to which the advertisement
  8489.         belongs. There are then two separate cases:
  8490.  
  8491.         o   If Area A the backbone, or if the router is  attached  to  a
  8492.             single  area,  the  calculation in Section 16.2 is run again
  8493.             for a single routing table entry. Then, if the router is  an
  8494.             area  border  router  attached to one or more transit areas,
  8495.             the calculation in Section 16.3 must be run  again  for  the
  8496.             single destination.  Finally, if the results of these calcu-
  8497.             lations have changed the cost to an AS boundary  router  (as
  8498.             would  be the case for a type 4 summary link) or to any for-
  8499.             warding addresses, the AS external links  will  have  to  be
  8500.             examined by rerunning the calculation in Section 16.4.
  8501.  
  8502.         o   Otherwise, if Area A is a transit area  (i.e.,  its  Transit
  8503.             capability  parameter  is  TRUE), the following calculations
  8504.             must be performed. There are two separate sub-cases:
  8505.  
  8506.             -   If the new summary link specifies a lower cost than  the
  8507.                 previous  instance (or if there was no previous instance
  8508.                 of the summary link) the  calculation  in  Section  16.3
  8509.  
  8510.  
  8511.  
  8512. [Moy]                                                         [Page 152]
  8513.  
  8514. Internet Draft               OSPF Version 2                November 1992
  8515.  
  8516.  
  8517.                 should be rerun for a single routing table entry, remov-
  8518.                 ing those next hops  belonging  to  Area  A  before  the
  8519.                 recalculation commences. If the results of this calcula-
  8520.                 tion changes the cost to an AS boundary router or to any
  8521.                 forwarding addresses, the AS external links will have to
  8522.                 be examined by  rerunning  the  calculation  in  Section
  8523.                 16.4.
  8524.  
  8525.             -   On the other hand, if the new summary link  specifies  a
  8526.                 larger  cost  than  the  previous instance, the complete
  8527.                 routing table calculation must be  rerun  starting  with
  8528.                 the Dijkstra algorithm specified in Section 16.1.
  8529.  
  8530.     16.6.  Incremental updates --- AS external links
  8531.  
  8532.         When a new AS external link advertisement is received, it is not
  8533.         necessary  to  recalculate  the  entire routing table.  Call the
  8534.         destination described by the AS external link  advertisement  N.
  8535.         N's  address  is  obtained  by  masking the advertisement's Link
  8536.         State ID with the network/subnet mask contained in the  body  of
  8537.         the  advertisement.  If there is already an intra-area or inter-
  8538.         area route to the destination,  no  recalculation  is  necessary
  8539.         (internal routes take precedence).
  8540.  
  8541.         Otherwise, the procedure in Section 16.4 will have  to  be  per-
  8542.         formed, but only for those AS external link advertisements whose
  8543.         destination is N.   Before  this  procedure  is  performed,  the
  8544.         present routing table entry for N should be invalidated.
  8545.  
  8546.  
  8547.     16.7.  Events generated as a result of routing table changes
  8548.  
  8549.         Changes to routing table entries sometimes cause the  OSPF  area
  8550.         border  routers  to take additional actions.  These routers need
  8551.         to act on the following routing table changes:
  8552.  
  8553.  
  8554.         o   The cost or path type of a routing table entry has  changed.
  8555.             If  the  destination described by this entry is a Network or
  8556.             AS boundary router, and this is not simply a  change  of  AS
  8557.             external routes, new summary link advertisements may have to
  8558.             be  generated  (potentially  one  for  each  attached  area,
  8559.             including the backbone).  See Section 12.4.3 for more infor-
  8560.             mation.  If a previously advertised entry has been  deleted,
  8561.             or  is  no  longer  advertisable  to  a particular area, the
  8562.             advertisement must be flushed from  the  routing  domain  by
  8563.             setting its age to MaxAge and reflooding (see Section 14.1).
  8564.  
  8565.  
  8566.  
  8567.  
  8568. [Moy]                                                         [Page 153]
  8569.  
  8570. Internet Draft               OSPF Version 2                November 1992
  8571.  
  8572.  
  8573.         o   A routing table entry associated with a  configured  virtual
  8574.             link  has  changed.  The destination of such a routing table
  8575.             entry is an area border  router.   The  change  indicates  a
  8576.             modification to the virtual link's cost or viability.
  8577.  
  8578.             If the entry indicates that the area border router is  newly
  8579.             reachable (via TOS 0), the corresponding virtual link is now
  8580.             operational.  An Interface Up event should be generated  for
  8581.             the  virtual  link,  which will cause a virtual adjacency to
  8582.             begin to form (see Section 10.3).  At this time the  virtual
  8583.             interface's IP address and the virtual neighbor's IP address
  8584.             are also calculated.
  8585.  
  8586.             If the entry indicates that the area  border  router  is  no
  8587.             longer reachable (via TOS 0), the virtual link and its asso-
  8588.             ciated adjacency should be destroyed.  This means an  Inter-
  8589.             face  Down event should be generated for the associated vir-
  8590.             tual link.
  8591.  
  8592.             If the cost of the entry has changed, and there is  a  fully
  8593.             established virtual adjacency, a new router links advertise-
  8594.             ment for the backbone must be originated.  This in turn  may
  8595.             cause further routing table changes.
  8596.  
  8597.  
  8598.     16.8.  Equal-cost multipath
  8599.  
  8600.         The OSPF protocol maintains multiple equal-cost  routes  to  all
  8601.         destinations.   This can be seen in the steps used above to cal-
  8602.         culate the routing table, and in the definition of  the  routing
  8603.         table structure.
  8604.  
  8605.         Each one of the  multiple  routes  will  be  of  the  same  type
  8606.         (intra-area,  inter-area,  type  1 external or type 2 external),
  8607.         cost, and will have the same  associated  area.   However,  each
  8608.         route specifies a separate next hop and advertising router.
  8609.  
  8610.         There is no requirement that a router running OSPF keep track of
  8611.         all possible equal-cost routes to a destination.  An implementa-
  8612.         tion may choose to keep only a fixed number  of  routes  to  any
  8613.         given  destination.   This does not affect any of the algorithms
  8614.         presented in this specification.
  8615.  
  8616.  
  8617.     16.9.  Building the non-zero-TOS portion of the routing table
  8618.  
  8619.         The OSPF protocol can calculate a different set  of  routes  for
  8620.         each IP TOS (see Section 2.4).  Support for TOS-based routing is
  8621.  
  8622.  
  8623.  
  8624. [Moy]                                                         [Page 154]
  8625.  
  8626. Internet Draft               OSPF Version 2                November 1992
  8627.  
  8628.  
  8629.         optional.  TOS-capable and non-TOS-capable routers can be  mixed
  8630.         in an OSPF routing domain.  Routers not supporting TOS calculate
  8631.         only the TOS 0 route to each destination.  These routes are then
  8632.         used  to forward all data traffic, regardless of the TOS indica-
  8633.         tions in the data packet's IP header.  A router  that  does  not
  8634.         support  TOS  indicates  this  fact to the other OSPF routers by
  8635.         clearing the T-bit in the Options  field  of  its  router  links
  8636.         advertisement.
  8637.  
  8638.         The above sections detailing the routing table calculations han-
  8639.         dle  the  TOS  0  case only.  In general, for routers supporting
  8640.         TOS-based routing, each piece of the routing  table  calculation
  8641.         must be rerun separately for the non-zero TOS values.  When cal-
  8642.         culating routes for TOS X, only TOS X metrics can be used.   Any
  8643.         link  state  advertisement  may specify a separate cost for each
  8644.         TOS (a cost for TOS 0 must always be specified).   The  encoding
  8645.         of TOS in OSPF link state advertisements is described in Section
  8646.         12.3.
  8647.  
  8648.         An advertisement can specify that it  is  restricted  to  TOS  0
  8649.         (i.e., non-zero TOS is not handled) by clearing the T-bit in the
  8650.         link state advertisement's Option  field.   Such  advertisements
  8651.         are not used when calculating routes for non-zero TOS.  For this
  8652.         reason, it is possible that a  destination  is  unreachable  for
  8653.         some  non-zero  TOS.   In this case, the TOS 0 path is used when
  8654.         forwarding packets (see Section 11.1).
  8655.  
  8656.         The following lists the modifications needed  when  running  the
  8657.         routing  table  calculation for a non-zero TOS value (called TOS
  8658.         X).  In general, routers and advertisements that do not  support
  8659.         TOS are omitted from the calculation.
  8660.  
  8661.  
  8662.         Calculating the shortest-path tree (Section  16.1).
  8663.             Routers that do not  support  TOS-based  routing  should  be
  8664.             omitted  from  the  shortest-path  tree  calculation.  These
  8665.             routers are identified as those having the  T-bit  reset  in
  8666.             the  Options  field  of  their  router links advertisements.
  8667.             Such  routers  should  never  be  added   to   the   Dijktra
  8668.             algorithm's  candidate  list,  nor should their router links
  8669.             advertisements be examined when adding the stub networks  to
  8670.             the  tree.  In particular, if the T-bit is reset in the cal-
  8671.             culating router's own router links  advertisement,  it  does
  8672.             not  run the shortest-path tree calculation for non-zero TOS
  8673.             values.
  8674.  
  8675.         Calculating the inter-area routes (Section  16.2).
  8676.             Inter-area paths are the concatenation of a path to an  area
  8677.  
  8678.  
  8679.  
  8680. [Moy]                                                         [Page 155]
  8681.  
  8682. Internet Draft               OSPF Version 2                November 1992
  8683.  
  8684.  
  8685.             border  router  with a summary link.  When calculating TOS X
  8686.             routes, both path components must also specify  TOS  X.   In
  8687.             other  words, only TOS X paths to the area border router are
  8688.             examined, and the area border router must be  advertising  a
  8689.             TOS  X  route to the destination.  Note that this means that
  8690.             summary link advertisements having the T-bit reset in  their
  8691.             Options field are not considered.
  8692.  
  8693.         Examining transit areas' summary links (Section 16.3).
  8694.             This calculation again considers the concatenation of a path
  8695.             to  an  area  border  router  with  a summary link.  As with
  8696.             inter-area routes, only TOS  X  paths  to  the  area  border
  8697.             router  are  examined,  and  the  area border router must be
  8698.             advertising a TOS X route to the destination.
  8699.  
  8700.         Calculating AS external routes (Section 16.4).
  8701.             This calculation considers the concatenation of a path to  a
  8702.             forwarding  address  with  an  AS external link.  Only TOS X
  8703.             paths to the forwarding address are  examined,  and  the  AS
  8704.             boundary  router  must  be  advertising a TOS X route to the
  8705.             destination.  Note that this means  that  AS  external  link
  8706.             advertisements having the T-bit reset in their Options field
  8707.             are not considered.
  8708.  
  8709.             In addition, the advertising AS boundary router must also be
  8710.             reachable  for its advertisements to be considered (see Sec-
  8711.             tion 16.4).  However, if the advertising router and the for-
  8712.             warding  address  are  not  one in the same, the advertising
  8713.             router need only be reachable via TOS 0.
  8714.  
  8715.  
  8716.  
  8717.  
  8718.  
  8719.  
  8720.  
  8721.  
  8722.  
  8723.  
  8724.  
  8725.  
  8726.  
  8727.  
  8728.  
  8729.  
  8730.  
  8731.  
  8732.  
  8733.  
  8734.  
  8735.  
  8736. [Moy]                                                         [Page 156]
  8737.  
  8738. Internet Draft               OSPF Version 2                November 1992
  8739.  
  8740.  
  8741. Footnotes
  8742.  
  8743.  
  8744.     [1]The graph's vertices represent either routers, transit  networks,
  8745.     or stub networks.  Since routers may belong to multiple areas, it is
  8746.     not possible to color the graph's vertices.
  8747.  
  8748.     [2]It is possible for all of a router's interfaces to be  unnumbered
  8749.     point-to-point  links.  In this case, an IP address must be assigned
  8750.     to the router.  This address will then be advertised in the router's
  8751.     router links advertisement as a host route.
  8752.  
  8753.     [3]Note that in these cases both interfaces, the non-virtual and the
  8754.     virtual, would have the same IP address.
  8755.  
  8756.     [4]Note that no host route is generated for, and no IP  packets  can
  8757.     be  addressed  to, interfaces to unnumbered point-to-point networks.
  8758.     This is regardless of such an interface's state.
  8759.  
  8760.     [5]It is instructive to see what happens when the Designated  Router
  8761.     for the network crashes.  Call the Designated Router for the network
  8762.     RT1, and the the  Backup  Designated  Router  RT2.   If  router  RT1
  8763.     crashes  (or  maybe  its  interface  to the network dies), the other
  8764.     routers on the network will  detect  RT1's  absence  within  Router-
  8765.     DeadInterval  seconds.  All routers may not detect this at precisely
  8766.     the same time; the routers that detect RT1's absence before RT2 does
  8767.     will, for a time, select RT2 to be both Designated Router and Backup
  8768.     Designated Router.  When RT2 detects that RT1 is gone it  will  move
  8769.     itself  to  Designated  Router.   At this time, the remaining router
  8770.     having highest Router Priority will be selected as Backup Designated
  8771.     Router.
  8772.  
  8773.     [6]On point-to-point networks, the lower  level  protocols  indicate
  8774.     whether  the neighbor is up and running.  Likewise, existence of the
  8775.     neighbor on virtual links is indicated by the routing table calcula-
  8776.     tion.   However,  in  both  these cases, the Hello Protocol is still
  8777.     used.  This ensures that  communication  between  the  neighbors  is
  8778.     bidirectional,  and  that  each  of  the neighbors has a functioning
  8779.     routing protocol layer.
  8780.  
  8781.     [7]When the identity of the Designated Router is changing, it may be
  8782.     quite common for a neighbor in this state to send the router a Data-
  8783.     base Description packet; this means that  there  is  some  momentary
  8784.     disagreement on the Designated Router's identity.
  8785.  
  8786.     [8]Note that it is possible for a router to resynchronize any of its
  8787.     fully  established adjacencies by setting the adjacency's state back
  8788.     to ExStart.  This will cause the  other  end  of  the  adjacency  to
  8789.  
  8790.  
  8791.  
  8792. [Moy]                                                         [Page 157]
  8793.  
  8794. Internet Draft               OSPF Version 2                November 1992
  8795.  
  8796.  
  8797.     process  a  Seq Number Mismatch event, and therefore to also go back
  8798.     to ExStart state.
  8799.  
  8800.     [9]The address space of IP networks and the address  space  of  OSPF
  8801.     Router  IDs  may overlap.  That is, a network may have an IP address
  8802.     which is identical (when considered as  a  32-bit  number)  to  some
  8803.     router's Router ID.
  8804.  
  8805.     [10]It is assumed that, for two different  address  ranges  matching
  8806.     the  destination,  one  range  is more specific than the other. Non-
  8807.     contiguous subnet masks can be configured to  violate  this  assump-
  8808.     tion.  Such subnet mask configurations cannot be handled by the OSPF
  8809.     protocol.
  8810.  
  8811.     [11]MaxAgeDiff is an architectural constant.  It indicates the  max-
  8812.     imum  dispersion  of  ages,  in seconds, that can occur for a single
  8813.     link state instance as it is flooded throughout the routing  domain.
  8814.     If  two advertisements differ by more than this, they are assumed to
  8815.     be different instances of the same advertisement.   This  can  occur
  8816.     when  a  router  restarts  and  loses track of its previous sequence
  8817.     number.  See Section 13.4 for more details.
  8818.  
  8819.     [12]When two  advertisements  have  different  checksums,  they  are
  8820.     assumed to be separate instances.  This can occur when a router res-
  8821.     tarts, and loses track of its previous  sequence  number.   In  this
  8822.     case, since the two advertisements have the same sequence number, it
  8823.     is not possible to determine which link state is actually newer.  If
  8824.     the wrong advertisement is accepted as newer, the originating router
  8825.     will originate another  instance.   See  Section  13.4  for  further
  8826.     details.
  8827.  
  8828.     [13]There is one instance where a lookup must be done based on  par-
  8829.     tial  information.   This  is  during the routing table calculation,
  8830.     when a network links advertisement must be found based solely on its
  8831.     Link State ID.  The lookup in this case is still well defined, since
  8832.     no two network advertisements can have the same Link State ID.
  8833.  
  8834.     [14]This clause covers the case: Inter-area routes are  not  summar-
  8835.     ized  to the backbone.  This is because inter-area routes are always
  8836.     associated with the backbone area.
  8837.  
  8838.     [15]This clause is only invoked when Area A is a transit  area  sup-
  8839.     porting  one  or more virtual links. For example, in the area confi-
  8840.     guration of Figure 6, Router RT11 need only originate a single  sum-
  8841.     mary link having the (collapsed) destination N9-N11,H1 into its con-
  8842.     nected transit area Area 2, since all of its other  eligible  routes
  8843.     have  next hops belonging to Area 2 (and as such only need be adver-
  8844.     tised by other area border routers; in this case, Routers  RT10  and
  8845.  
  8846.  
  8847.  
  8848. [Moy]                                                         [Page 158]
  8849.  
  8850. Internet Draft               OSPF Version 2                November 1992
  8851.  
  8852.  
  8853.     RT7).
  8854.  
  8855.     [16]By keeping more information in the routing table, it is possible
  8856.     for an implementation to recalculate the shortest path tree only for
  8857.     a single area.  In fact, there are incremental algorithms that allow
  8858.     an implementation to recalculate only a portion of the shortest path
  8859.     tree [BBN].  These algorithms are beyond the scope of this  specifi-
  8860.     cation.
  8861.  
  8862.     [17]This is how the Link state request list is emptied, which  even-
  8863.     tually causes the neighbor state to transition to Full.  See Section
  8864.     10.9 for more details.
  8865.  
  8866.     [18]It should be a relatively rare occurrence for an advertisement's
  8867.     age to reach MaxAge.  Usually, the advertisement will be replaced by
  8868.     a more recent instance before it ages out.
  8869.  
  8870.     [19]Only the TOS 0 routes are important here.  This is  because  all
  8871.     routing protocol packets are sent with TOS= 0.  See Appendix A.
  8872.  
  8873.     [20]It may be the case that paths to  certain  destinations  do  not
  8874.     vary  based on TOS.  For these destinations, the routing calculation
  8875.     need not be repeated for each TOS value.  In  addition,  there  need
  8876.     only be a single routing table entry for these destinations (instead
  8877.     of a separate entry for each TOS value).
  8878.  
  8879.     [21]Strictly speaking, because of equal-cost  multipath,  the  algo-
  8880.     rithm  does not create a tree.  We continue to use the "tree" termi-
  8881.     nology because that is  what  occurs  most  often  in  the  existing
  8882.     literature.
  8883.  
  8884.     [22]This means that before data traffic will flow between a pair  of
  8885.     neighboring  routers,  their  link state databases must be synchron-
  8886.     ized.  Before synchronization (neighbor state < Full), a router will
  8887.     not  include the connection to its neighbor in its link state adver-
  8888.     tisements.
  8889.  
  8890.     [23]As a result of this clause, when a virtual link  exists  between
  8891.     the  calculating  router  and  an AS boundary router, the intra-area
  8892.     path through the virtual link's transit  area  is  always  preferred
  8893.     over the virtual link itself.
  8894.  
  8895.     [24]When the forwarding address is non-zero, it should  point  to  a
  8896.     router  belonging  to another Autonomous System.  See Section 12.4.5
  8897.     for more details.
  8898.  
  8899.  
  8900.  
  8901.  
  8902.  
  8903.  
  8904. [Moy]                                                         [Page 159]
  8905.  
  8906. Internet Draft               OSPF Version 2                November 1992
  8907.  
  8908.  
  8909. References
  8910.  
  8911.     [BBN]           McQuillan, J.M., Richer, I. and Rosen, E.C.  ARPANET
  8912.                     Routing   Algorithm   Improvements.   BBN  Technical
  8913.                     Report 3803, April 1978.
  8914.  
  8915.     [DEC]           Digital Equipment Corporation.  Information process-
  8916.                     ing  systems  -- Data communications -- Intermediate
  8917.                     System to Intermediate System  Intra-Domain  Routing
  8918.                     Protocol.  October 1987.
  8919.  
  8920.     [McQuillan]     McQuillan, J. et.al.  The New Routing Algorithm  for
  8921.                     the  Arpanet.   IEEE Transactions on Communications,
  8922.                     May 1980.
  8923.  
  8924.     [Perlman]       Perlman, Radia.  Fault-Tolerant Broadcast of Routing
  8925.                     Information.  Computer Networks, Dec. 1983.
  8926.  
  8927.     [RFC 791]       Postel, Jon.  Internet Protocol.  September 1981
  8928.  
  8929.     [RFC 905]       ISO Transport Protocol Specification, ISO  DP  8073.
  8930.                     April 1984.
  8931.  
  8932.     [RFC 1112]      Deering, S.E.  Host extensions for IP  multicasting.
  8933.                     May 1988.
  8934.  
  8935.     [RFC 1213]      McCloghrie,  K.,  Rose,  M.T.  (editors)  Management
  8936.                     Information  Base  for network management of TCP/IP-
  8937.                     based internets: MIB-II.  March 1991.
  8938.  
  8939.     [RFC 1247]      Moy, J.  OSPF Version 2.  July 1991.
  8940.  
  8941.     [RFC 1338]      Fuller, V.; Li, T.; Yu, J.Y.; Varadhan,  K.   Super-
  8942.                     netting: An address assignment and aggregation stra-
  8943.                     tegy.  June 1992.
  8944.  
  8945.     [RFC 1340]      Reynolds, J. and Postel, J.  Assigned Numbers.  July
  8946.                     1992.
  8947.  
  8948.     [RFC 1349]      Almquist, P.  Type of Service in the Internet Proto-
  8949.                     col Suite.  July 1992.
  8950.  
  8951.     [RS-85-153]     Leiner, Dr. Barry M.,  et.al.   The  DARPA  Internet
  8952.                     Protocol Suite.  DDN Protocol Handbook, April 1985.
  8953.  
  8954.     [MOSPF]         Moy, J.  Multicast Extensions to OSPF.  TBD.
  8955.  
  8956.  
  8957.  
  8958.  
  8959.  
  8960. [Moy]                                                         [Page 160]
  8961.  
  8962. Internet Draft               OSPF Version 2                November 1992
  8963.  
  8964.  
  8965.     [OSPF MIB]      Baker, F. and Coltun, R.  OSPF Version 2  Management
  8966.                     Information Base.  TBD.
  8967.  
  8968.     [OSPF Traps]    Baker F. and Coltun, R.  OSPF Version 2 Traps.  TBD.
  8969.  
  8970.  
  8971.  
  8972.  
  8973.  
  8974.  
  8975.  
  8976.  
  8977.  
  8978.  
  8979.  
  8980.  
  8981.  
  8982.  
  8983.  
  8984.  
  8985.  
  8986.  
  8987.  
  8988.  
  8989.  
  8990.  
  8991.  
  8992.  
  8993.  
  8994.  
  8995.  
  8996.  
  8997.  
  8998.  
  8999.  
  9000.  
  9001.  
  9002.  
  9003.  
  9004.  
  9005.  
  9006.  
  9007.  
  9008.  
  9009.  
  9010.  
  9011.  
  9012.  
  9013.  
  9014.  
  9015.  
  9016. [Moy]                                                         [Page 161]
  9017.  
  9018. Internet Draft               OSPF Version 2                November 1992
  9019.  
  9020.  
  9021. A. OSPF data formats
  9022.  
  9023.     This appendix describes the format of OSPF protocol packets and OSPF
  9024.     link state advertisements.  The OSPF protocol runs directly over the
  9025.     IP network layer.   Before  any  data  formats  are  described,  the
  9026.     details of the OSPF encapsulation are explained.
  9027.  
  9028.     Next the OSPF options field  is  described.   This  field  describes
  9029.     various  capabilities  that may or may not be supported by pieces of
  9030.     the OSPF routing domain. The OSPF options field is contained in OSPF
  9031.     Hello  packets,  Database Description packets and in OSPF link state
  9032.     advertisements.
  9033.  
  9034.     OSPF packet formats are detailed in Section A.3.  A  description  of
  9035.     OSPF link state advertisements appears in Section A.4.
  9036.  
  9037. A.1 Encapsulation of OSPF packets
  9038.  
  9039.     OSPF runs directly over the Internet Protocol's network layer.  OSPF
  9040.     packets  are  therefore  encapsulated solely by IP and local network
  9041.     headers.
  9042.  
  9043.     OSPF does not define a way to fragment  its  protocol  packets,  and
  9044.     depends  on  IP  fragmentation when transmitting packets larger than
  9045.     the network MTU.  The OSPF packet types that are likely to be  large
  9046.     (Database  Description  Packets,  Link  State  Request,  Link  State
  9047.     Update, and Link State Acknowledgment packets) can usually be  split
  9048.     into  several separate protocol packets, without loss of functional-
  9049.     ity.  This is recommended; IP fragmentation should be avoided  when-
  9050.     ever  possible.   Using this reasoning, an attempt should be made to
  9051.     limit the sizes of packets sent over virtual  links  to  576  bytes.
  9052.     However,  if  necessary,  the  length  of  OSPF packets can be up to
  9053.     65,535 bytes (including the IP header).
  9054.  
  9055.     The other important features of OSPF's IP encapsulation are:
  9056.  
  9057.     o   Use of IP multicast.  Some OSPF  messages  are  multicast,  when
  9058.         sent  over  multi-access  networks.   Two  distinct IP multicast
  9059.         addresses  are  used.   Packets  destined  to  these   multicast
  9060.         addresses  should never be forwarded.  Such packets are meant to
  9061.         travel a single hop only.  To ensure that these packets will not
  9062.         travel multiple hops, their IP TTL must be set to 1.
  9063.  
  9064.         AllSPFRouters
  9065.             This  multicast  address  has  been   assigned   the   value
  9066.             224.0.0.5.   All  routers running OSPF should be prepared to
  9067.             receive packets sent to this  address.   Hello  packets  are
  9068.             always  sent  to  this  destination.  Also, certain protocol
  9069.  
  9070.  
  9071.  
  9072. [Moy]                                                         [Page 162]
  9073.  
  9074. Internet Draft               OSPF Version 2                November 1992
  9075.  
  9076.  
  9077.             packets are sent to this address during  the  flooding  pro-
  9078.             cedure.
  9079.  
  9080.         AllDRouters
  9081.             This  multicast  address  has  been   assigned   the   value
  9082.             224.0.0.6.  Both the Designated Router and Backup Designated
  9083.             Router must be prepared to receive packets destined to  this
  9084.             address.   Certain  packets  are sent to this address during
  9085.             the flooding procedure.
  9086.  
  9087.     o   OSPF is IP protocol number 89.  This number has been  registered
  9088.         with the Network Information Center.  IP protocol number assign-
  9089.         ments are documented in [RFC 1340].
  9090.  
  9091.     o   Routing protocol packets are sent with IP TOS of  0.   The  OSPF
  9092.         protocol  supports  TOS-based routing.  Routes to any particular
  9093.         destination may vary based on TOS.  However,  all  OSPF  routing
  9094.         protocol  packets are sent using the normal service TOS value of
  9095.         binary 0000 defined in [RFC 1349].
  9096.  
  9097.     o   Routing protocol packets are sent  with  IP  precedence  set  to
  9098.         Internetwork  Control.   OSPF  protocol  packets should be given
  9099.         precedence over regular IP data traffic,  in  both  sending  and
  9100.         receiving.   Setting the IP precedence field in the IP header to
  9101.         Internetwork Control [RFC 791] may help  implement  this  objec-
  9102.         tive.
  9103.  
  9104.  
  9105.  
  9106.  
  9107.  
  9108.  
  9109.  
  9110.  
  9111.  
  9112.  
  9113.  
  9114.  
  9115.  
  9116.  
  9117.  
  9118.  
  9119.  
  9120.  
  9121.  
  9122.  
  9123.  
  9124.  
  9125.  
  9126.  
  9127.  
  9128. [Moy]                                                         [Page 163]
  9129.  
  9130. Internet Draft               OSPF Version 2                November 1992
  9131.  
  9132.  
  9133. A.2 The options field
  9134.  
  9135.     The OSPF options field is present in OSPF  Hello  packets,  Database
  9136.     Description  packets and all link state advertisements.  The options
  9137.     field enables OSPF routers to  support  (or  not  support)  optional
  9138.     capabilities,  and  to  communicate  their capability level to other
  9139.     OSPF routers.  Through this mechanism routers of differing capabili-
  9140.     ties can be mixed within an OSPF routing domain.
  9141.  
  9142.     When used in Hello packets, the options field  allows  a  router  to
  9143.     reject  a neighbor because of a capability mismatch.  Alternatively,
  9144.     when capabilities are exchanged in Database  Description  packets  a
  9145.     router  can  choose  not  to forward certain LSA types to a neighbor
  9146.     because of its reduced functionality.  Lastly, listing  capabilities
  9147.     in LSAs allows routers to route traffic around reduced functionality
  9148.     routers, by excluding them from parts of the routing table  calcula-
  9149.     tion.
  9150.  
  9151.     Two capabilities are currently defined.  For  each  capability,  the
  9152.     effect  of  the  capability's  appearance (or lack of appearance) in
  9153.     Hello packets, Database Description packets and  link  state  adver-
  9154.     tisements  is  specified  below.   For example, the external routing
  9155.     capability (below called the E-bit) has meaning only in  OSPF  Hello
  9156.     Packets.   Routers should reset (i.e.  clear) the unassigned part of
  9157.     the capability field when sending Hello packets or Database Descrip-
  9158.     tion packets and when originating link state advertisements.
  9159.  
  9160.     Additional capabilities may be  assigned  in  the  future.   Routers
  9161.     encountering  unrecognized  capabilities  in received Hello Packets,
  9162.     Database Description packets or  link  state  advertisements  should
  9163.     ignore the capability and process the packet/advertisement normally.
  9164.  
  9165.                                +-+-+-+-+-+-+-+-+
  9166.                                | | | | | | |E|T|
  9167.                                +-+-+-+-+-+-+-+-+
  9168.  
  9169.                              The options field
  9170.  
  9171.  
  9172.     T-bit
  9173.         This describes the router's TOS capability.   If  the  T-bit  is
  9174.         reset, then the router supports only a single TOS (TOS 0).  Such
  9175.         a router is also said  to  be  incapable  of  TOS-routing.   The
  9176.         absence  of the T-bit in a router links advertisement causes the
  9177.         router to be skipped when building a non-zero TOS  shortest-path
  9178.         tree  (see  Section 16.9).  In other words, routers incapable of
  9179.         TOS routing will be avoided as much as possible when  forwarding
  9180.         data  traffic  requesting a non-zero TOS.  The absence of the T-
  9181.  
  9182.  
  9183.  
  9184. [Moy]                                                         [Page 164]
  9185.  
  9186. Internet Draft               OSPF Version 2                November 1992
  9187.  
  9188.  
  9189.         bit in a summary link  advertisement  or  an  AS  external  link
  9190.         advertisement  indicates  that the advertisement is describing a
  9191.         TOS 0 route only (and not routes for non-zero TOS).
  9192.  
  9193.     E-bit
  9194.         AS external link advertisements  are  not  flooded  into/through
  9195.         OSPF  stub  areas (see Section 3.6).  The E-bit ensures that all
  9196.         members of a stub area agree on that area's configuration.   The
  9197.         E-bit  is meaningful only in OSPF Hello packets.  When the E-bit
  9198.         is reset in the Hello packet sent out a particular interface, it
  9199.         means  that the router will neither send nor receive AS external
  9200.         link state advertisements on that interface (in other words, the
  9201.         interface connects to a stub area).  Two routers will not become
  9202.         neighbors unless they agree on the state of the E-bit.
  9203.  
  9204.  
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240. [Moy]                                                         [Page 165]
  9241.  
  9242. Internet Draft               OSPF Version 2                November 1992
  9243.  
  9244.  
  9245. A.3 OSPF Packet Formats
  9246.  
  9247.     There are five distinct OSPF packet types.  All  OSPF  packet  types
  9248.     begin  with  a  standard  24  byte header.  This header is described
  9249.     first.  Each packet type is then described in a succeeding  section.
  9250.     In  these  sections each packet's division into fields is displayed,
  9251.     and then the field definitions are enumerated.
  9252.  
  9253.     All OSPF packet types (other than the OSPF Hello packets) deal  with
  9254.     lists  of link state advertisements.  For example, Link State Update
  9255.     packets implement the flooding of advertisements throughout the OSPF
  9256.     routing  domain.   Because  of this, OSPF protocol packets cannot be
  9257.     parsed unless the format of link state advertisements is also under-
  9258.     stood.  The format of Link state advertisements is described in Sec-
  9259.     tion A.4.
  9260.  
  9261.     The receive processing of OSPF packets is detailed in  Section  8.2.
  9262.     The sending of OSPF packets is explained in Section 8.1.
  9263.  
  9264.  
  9265.  
  9266.  
  9267.  
  9268.  
  9269.  
  9270.  
  9271.  
  9272.  
  9273.  
  9274.  
  9275.  
  9276.  
  9277.  
  9278.  
  9279.  
  9280.  
  9281.  
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296. [Moy]                                                         [Page 166]
  9297.  
  9298. Internet Draft               OSPF Version 2                November 1992
  9299.  
  9300.  
  9301. A.3.1 The OSPF packet header
  9302.  
  9303.     Every OSPF packet starts with a common 24 byte header.  This  header
  9304.     contains  all  the  necessary  information  to determine whether the
  9305.     packet should be accepted for further processing.   This  determina-
  9306.     tion is described in Section 8.2 of the specification.
  9307.  
  9308.  
  9309.         0                   1                   2                   3
  9310.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9311.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9312.        |   Version #   |     Type      |         Packet length         |
  9313.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9314.        |                          Router ID                            |
  9315.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9316.        |                           Area ID                             |
  9317.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9318.        |           Checksum            |             Autype            |
  9319.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9320.        |                       Authentication                          |
  9321.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9322.        |                       Authentication                          |
  9323.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9324.  
  9325.  
  9326.  
  9327.     Version #
  9328.         The OSPF version number.  This specification documents version 2
  9329.         of the protocol.
  9330.  
  9331.     Type
  9332.         The OSPF packet types are as follows.  The  format  of  each  of
  9333.         these packet types is described in a succeeding section.
  9334.  
  9335.  
  9336.  
  9337.                           Type   Description
  9338.                           ________________________________
  9339.                           1      Hello
  9340.                           2      Database Description
  9341.                           3      Link State Request
  9342.                           4      Link State Update
  9343.                           5      Link State Acknowledgment
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352. [Moy]                                                         [Page 167]
  9353.  
  9354. Internet Draft               OSPF Version 2                November 1992
  9355.  
  9356.  
  9357.     Packet length
  9358.         The length  of  the  protocol  packet  in  bytes.   This  length
  9359.         includes the standard OSPF header.
  9360.  
  9361.     Router ID
  9362.         The Router ID of the packet's source.  In OSPF, the  source  and
  9363.         destination  of a routing protocol packet are the two ends of an
  9364.         (potential) adjacency.
  9365.  
  9366.     Area ID
  9367.         A 32 bit number identifying the area that  this  packet  belongs
  9368.         to.   All  OSPF packets are associated with a single area.  Most
  9369.         travel a single hop only.  Packets  travelling  over  a  virtual
  9370.         link are labelled with the backbone area ID of 0.
  9371.  
  9372.     Checksum
  9373.         The standard IP checksum of the entire contents of  the  packet,
  9374.         excluding  the  64-bit  authentication  field.  This checksum is
  9375.         calculated as the 16-bit one's complement of the  one's  comple-
  9376.         ment  sum  of  all the 16-bit words in the packet, excepting the
  9377.         authentication field.  If the packet's length is not an integral
  9378.         number of 16-bit words, the packet is padded with a byte of zero
  9379.         before checksumming.
  9380.  
  9381.     AuType
  9382.         Identifies the authentication scheme to be used for the  packet.
  9383.         Authentication  is discussed in Appendix D of the specification.
  9384.         Consult Appendix D for a list of the currently defined authenti-
  9385.         cation types.
  9386.  
  9387.     Authentication
  9388.         A 64-bit field for use by the authentication scheme.
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.  
  9404.  
  9405.  
  9406.  
  9407.  
  9408. [Moy]                                                         [Page 168]
  9409.  
  9410. Internet Draft               OSPF Version 2                November 1992
  9411.  
  9412.  
  9413. A.3.2 The Hello packet
  9414.  
  9415.     Hello packets are OSPF  packet  type  1.   These  packets  are  sent
  9416.     periodically on all interfaces (including virtual links) in order to
  9417.     establish and maintain neighbor relationships.  In addition,  Hellos
  9418.     are  multicast  on  those  physical  networks  having a multicast or
  9419.     broadcast capability,  enabling  dynamic  discovery  of  neighboring
  9420.     routers.
  9421.  
  9422.     All routers connected to a common  network  must  agree  on  certain
  9423.     parameters  (network mask, hello and dead intervals).  These parame-
  9424.     ters are included in Hello packets, so that differences can  inhibit
  9425.     the  forming  of  neighbor relationships.  A detailed explanation of
  9426.     the receive processing for Hello packets  is  presented  in  Section
  9427.     10.5.  The sending of Hello packets is covered in Section 9.5.
  9428.  
  9429.  
  9430.         0                   1                   2                   3
  9431.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9432.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9433.        |   Version #   |       1       |         Packet length         |
  9434.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9435.        |                          Router ID                            |
  9436.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9437.        |                           Area ID                             |
  9438.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9439.        |           Checksum            |             Autype            |
  9440.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9441.        |                       Authentication                          |
  9442.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9443.        |                       Authentication                          |
  9444.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9445.        |                        Network Mask                           |
  9446.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9447.        |         HelloInt              |    Options    |    Rtr Pri    |
  9448.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9449.        |                           DeadInt                             |
  9450.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9451.        |                      Designated Router                        |
  9452.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9453.        |                   Backup Designated Router                    |
  9454.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9455.        |                          Neighbor                             |
  9456.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9457.        |                              ...                              |
  9458.  
  9459.  
  9460.  
  9461.  
  9462.  
  9463.  
  9464. [Moy]                                                         [Page 169]
  9465.  
  9466. Internet Draft               OSPF Version 2                November 1992
  9467.  
  9468.  
  9469.     Network mask
  9470.         The network mask associated with this interface.   For  example,
  9471.         if  the  interface  is  to a class B network whose third byte is
  9472.         used for subnetting, the network mask is 0xffffff00.
  9473.  
  9474.     Options
  9475.         The optional capabilities supported by the router, as documented
  9476.         in Section A.2.
  9477.  
  9478.     HelloInt
  9479.         The number of seconds between this router's Hello packets.
  9480.  
  9481.     Rtr Pri
  9482.         This router's Router  Priority.   Used  in  (Backup)  Designated
  9483.         Router  election.  If set to 0, the router will be ineligible to
  9484.         become (Backup) Designated Router.
  9485.  
  9486.     Deadint
  9487.         The number of seconds before declaring a silent router down.
  9488.  
  9489.     Designated Router
  9490.         The identity of the Designated Router for this network,  in  the
  9491.         view  of the advertising router.  The Designated Router is iden-
  9492.         tified here by its IP interface address on the network.  Set  to
  9493.         0 if there is no Designated Router.
  9494.  
  9495.     Backup Designated Router
  9496.         The identity of the Backup Designated Router for  this  network,
  9497.         in  the  view  of the advertising router.  The Backup Designated
  9498.         Router is identified here by its IP  interface  address  on  the
  9499.         network.  Set to 0 if there is no backup Designated Router.
  9500.  
  9501.     Neighbor
  9502.         The Router IDs of each router from whom valid Hello packets have
  9503.         been  seen  recently on the network.  Recently means in the last
  9504.         DeadInt seconds.
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.  
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520. [Moy]                                                         [Page 170]
  9521.  
  9522. Internet Draft               OSPF Version 2                November 1992
  9523.  
  9524.  
  9525. A.3.3 The Database Description packet
  9526.  
  9527.     Database Description packets are OSPF packet type 2.  These  packets
  9528.     are exchanged when an adjacency is being initialized.  They describe
  9529.     the contents of the topological database.  Multiple packets  may  be
  9530.     used  to  describe  the  database.  For this purpose a poll-response
  9531.     procedure is used.  One of the routers is designated to  be  master,
  9532.     the  other  a  slave.  The master sends Database Description packets
  9533.     (polls) which are acknowledged by Database Description packets  sent
  9534.     by the slave (responses).  The responses are linked to the polls via
  9535.     the packets' sequence numbers.
  9536.  
  9537.     The format of the Database Description packet  is  very  similar  to
  9538.     both  the  Link State Request and Link State Acknowledgment packets.
  9539.     The main part of all three is a list of items, each item  describing
  9540.     a  piece  of  the  topological  database.   The  sending of Database
  9541.     Description Packets is documented in Section 10.8.  The reception of
  9542.     Database Description packets is documented in Section 10.6.
  9543.  
  9544.  
  9545.         0                   1                   2                   3
  9546.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9547.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9548.        |   Version #   |       2       |         Packet length         |
  9549.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9550.        |                          Router ID                            |
  9551.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9552.        |                           Area ID                             |
  9553.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9554.        |           Checksum            |             Autype            |
  9555.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9556.        |                       Authentication                          |
  9557.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9558.        |                       Authentication                          |
  9559.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9560.        |       0       |       0       |    Options    |0|0|0|0|0|I|M|MS
  9561.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9562.        |                     DD sequence number                        |
  9563.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9564.        |                                                               |
  9565.        +-                                                             -+
  9566.        |                             A                                 |
  9567.        +-                 Link State Advertisement                    -+
  9568.        |                           Header                              |
  9569.        +-                                                             -+
  9570.        |                                                               |
  9571.        +-                                                             -+
  9572.        |                                                               |
  9573.  
  9574.  
  9575.  
  9576. [Moy]                                                         [Page 171]
  9577.  
  9578. Internet Draft               OSPF Version 2                November 1992
  9579.  
  9580.  
  9581.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9582.        |                              ...                              |
  9583.  
  9584.  
  9585.  
  9586.  
  9587.     0   These fields are reserved.  They must be 0.
  9588.  
  9589.     Options
  9590.         The optional capabilities supported by the router, as documented
  9591.         in Section A.2.
  9592.  
  9593.     I-bit
  9594.         The Init bit.  When set to 1, this packet is the  first  in  the
  9595.         sequence of database descriptions.
  9596.  
  9597.     M-bit
  9598.         The More bit.  When set to 1, it indicates  that  more  database
  9599.         descriptions are to follow.
  9600.  
  9601.     MS-bit
  9602.         The Master/Slave bit.  When set to  1,  it  indicates  that  the
  9603.         router is the master during the database exchange process.  Oth-
  9604.         erwise, the router is the slave.
  9605.  
  9606.     DD sequence number
  9607.         Used to sequence the collection of database description packets.
  9608.         The  initial  value (indicated by the Init bit being set) should
  9609.         be unique.  The sequence number then increments until  the  com-
  9610.         plete database description has been sent.
  9611.  
  9612.  
  9613.     The rest of the packet consists of a (possibly partial) list of  the
  9614.     topological database's pieces.  Each link state advertisement in the
  9615.     database is described by its link  state  header.   The  link  state
  9616.     header is documented in Section A.4.1.  It contains all the informa-
  9617.     tion required to uniquely identify both the  advertisement  and  the
  9618.     advertisement's current instance.
  9619.  
  9620.  
  9621.  
  9622.  
  9623.  
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632. [Moy]                                                         [Page 172]
  9633.  
  9634. Internet Draft               OSPF Version 2                November 1992
  9635.  
  9636.  
  9637. A.3.4 The Link State Request packet
  9638.  
  9639.     Link State Request packets are OSPF packet type 3.  After exchanging
  9640.     Database Description packets with a neighboring router, a router may
  9641.     find that parts of its topological database are out  of  date.   The
  9642.     Link  State  Request  packet  is  used  to request the pieces of the
  9643.     neighbor's database that are more up to date.  Multiple  Link  State
  9644.     Request  packets  may  need  to  be used.  The sending of Link State
  9645.     Request packets is the last step in bringing up an adjacency.
  9646.  
  9647.     A router that sends a Link State Request packet has in mind the pre-
  9648.     cise instance of the database pieces it is requesting (defined by LS
  9649.     sequence number, LS checksum, and LS age).  It may receive even more
  9650.     recent instances in response.
  9651.  
  9652.     The sending of Link State Request packets is documented  in  Section
  9653.     10.9.   The reception of Link State Request packets is documented in
  9654.     Section 10.7.
  9655.  
  9656.  
  9657.         0                   1                   2                   3
  9658.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9659.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9660.        |   Version #   |       3       |         Packet length         |
  9661.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9662.        |                          Router ID                            |
  9663.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9664.        |                           Area ID                             |
  9665.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9666.        |           Checksum            |             Autype            |
  9667.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9668.        |                       Authentication                          |
  9669.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9670.        |                       Authentication                          |
  9671.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9672.        |                          LS type                              |
  9673.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9674.        |                       Link State ID                           |
  9675.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9676.        |                     Advertising Router                        |
  9677.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9678.        |                              ...                              |
  9679.  
  9680.  
  9681.     Each advertisement requested is specified by its LS type, Link State
  9682.     ID, and Advertising Router.  This uniquely identifies the advertise-
  9683.     ment, but not its instance.  Link State Request packets  are  under-
  9684.     stood  to  be  requests  for the most recent instance (whatever that
  9685.  
  9686.  
  9687.  
  9688. [Moy]                                                         [Page 173]
  9689.  
  9690. Internet Draft               OSPF Version 2                November 1992
  9691.  
  9692.  
  9693.     might be).
  9694.  
  9695.  
  9696.  
  9697.  
  9698.  
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.  
  9710.  
  9711.  
  9712.  
  9713.  
  9714.  
  9715.  
  9716.  
  9717.  
  9718.  
  9719.  
  9720.  
  9721.  
  9722.  
  9723.  
  9724.  
  9725.  
  9726.  
  9727.  
  9728.  
  9729.  
  9730.  
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744. [Moy]                                                         [Page 174]
  9745.  
  9746. Internet Draft               OSPF Version 2                November 1992
  9747.  
  9748.  
  9749. A.3.5 The Link State Update packet
  9750.  
  9751.     Link State Update packets are OSPF packet  type  4.   These  packets
  9752.     implement  the  flooding  of  link  state advertisements.  Each Link
  9753.     State Update packet carries a collection of  link  state  advertise-
  9754.     ments  one  hop  further from its origin.  Several link state adver-
  9755.     tisements may be included in a single packet.
  9756.  
  9757.     Link State Update packets are multicast on those  physical  networks
  9758.     that  support  multicast/broadcast.   In  order to make the flooding
  9759.     procedure reliable, flooded advertisements are acknowledged in  Link
  9760.     State  Acknowledgment  packets.  If retransmission of certain adver-
  9761.     tisements is necessary, the retransmitted advertisements are  always
  9762.     carried  by unicast Link State Update packets.  For more information
  9763.     on the reliable flooding of link state advertisements, consult  Sec-
  9764.     tion 13.
  9765.  
  9766.  
  9767.         0                   1                   2                   3
  9768.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9769.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9770.        |   Version #   |       4       |         Packet length         |
  9771.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9772.        |                          Router ID                            |
  9773.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9774.        |                           Area ID                             |
  9775.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9776.        |           Checksum            |             Autype            |
  9777.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9778.        |                       Authentication                          |
  9779.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9780.        |                       Authentication                          |
  9781.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9782.        |                      # advertisements                         |
  9783.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9784.        |                                                               |
  9785.        +-                                                            +-+
  9786.        |                  Link state advertisements                    |
  9787.        +-                                                            +-+
  9788.        |                              ...                              |
  9789.  
  9790.  
  9791.  
  9792.     # advertisements
  9793.         The number of link state advertisements included in this update.
  9794.  
  9795.  
  9796.  
  9797.  
  9798.  
  9799.  
  9800. [Moy]                                                         [Page 175]
  9801.  
  9802. Internet Draft               OSPF Version 2                November 1992
  9803.  
  9804.  
  9805.     The body of the Link State Update packet consists of a list of  link
  9806.     state  advertisements.   Each  advertisement begins with a common 20
  9807.     byte header, the link state advertisement header.   This  header  is
  9808.     described  in  Section  A.4.1.  Otherwise, the format of each of the
  9809.     five types of link state advertisements is different.  Their formats
  9810.     are described in Section A.4.
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.  
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.  
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.  
  9838.  
  9839.  
  9840.  
  9841.  
  9842.  
  9843.  
  9844.  
  9845.  
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.  
  9855.  
  9856. [Moy]                                                         [Page 176]
  9857.  
  9858. Internet Draft               OSPF Version 2                November 1992
  9859.  
  9860.  
  9861. A.3.6 The Link State Acknowledgment packet
  9862.  
  9863.     Link State Acknowledgment Packets are OSPF packet type 5.   To  make
  9864.     the  flooding  of link state advertisements reliable, flooded adver-
  9865.     tisements  are  explicitly  acknowledged.   This  acknowledgment  is
  9866.     accomplished  through  the  sending and receiving of Link State Ack-
  9867.     nowledgment packets.  Multiple link state advertisements can be ack-
  9868.     nowledged in a single packet.
  9869.  
  9870.     Depending on the state of the sending interface and  the  source  of
  9871.     the  advertisements  being acknowledged, a Link State Acknowledgment
  9872.     packet is sent either to the multicast address AllSPFRouters, to the
  9873.     multicast address AllDRouters, or as a unicast.  The sending of Link
  9874.     State Acknowledgement packets is documented in  Section  13.5.   The
  9875.     reception  of  Link  State  Acknowledgement packets is documented in
  9876.     Section 13.7.
  9877.  
  9878.     The format of this packet is similar to that of the Data Description
  9879.     packet.   The  body  of  both packets is simply a list of link state
  9880.     advertisement headers.
  9881.  
  9882.  
  9883.         0                   1                   2                   3
  9884.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9885.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9886.        |   Version #   |       5       |         Packet length         |
  9887.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9888.        |                          Router ID                            |
  9889.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9890.        |                           Area ID                             |
  9891.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9892.        |           Checksum            |             Autype            |
  9893.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9894.        |                       Authentication                          |
  9895.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9896.        |                       Authentication                          |
  9897.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9898.        |                                                               |
  9899.        +-                                                             -+
  9900.        |                             A                                 |
  9901.        +-                 Link State Advertisement                    -+
  9902.        |                           Header                              |
  9903.        +-                                                             -+
  9904.        |                                                               |
  9905.        +-                                                             -+
  9906.        |                                                               |
  9907.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9908.        |                              ...                              |
  9909.  
  9910.  
  9911.  
  9912. [Moy]                                                         [Page 177]
  9913.  
  9914. Internet Draft               OSPF Version 2                November 1992
  9915.  
  9916.  
  9917.     Each acknowledged link state advertisement is described by its  link
  9918.     state header.  The link state header is documented in Section A.4.1.
  9919.     It contains all the information required to uniquely  identify  both
  9920.     the advertisement and the advertisement's current instance.
  9921.  
  9922.  
  9923.  
  9924.  
  9925.  
  9926.  
  9927.  
  9928.  
  9929.  
  9930.  
  9931.  
  9932.  
  9933.  
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.  
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.  
  9950.  
  9951.  
  9952.  
  9953.  
  9954.  
  9955.  
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.  
  9966.  
  9967.  
  9968. [Moy]                                                         [Page 178]
  9969.  
  9970. Internet Draft               OSPF Version 2                November 1992
  9971.  
  9972.  
  9973. A.4 Link state advertisement formats
  9974.  
  9975.     There are five distinct types of link  state  advertisements.   Each
  9976.     link  state  advertisement begins with a standard 20-byte link state
  9977.     header.  This header is explained in Section A.4.1.  Succeeding sec-
  9978.     tions then diagram the separate link state advertisement types.
  9979.  
  9980.     Each link state advertisement describes a piece of the OSPF  routing
  9981.     domain.   Every  router originates a router links advertisement.  In
  9982.     addition, whenever the router is elected Designated Router, it  ori-
  9983.     ginates  a  network  links advertisement.  Other types of link state
  9984.     advertisements may also be originated (see Section 12.4).  All  link
  9985.     state  advertisements  are  then flooded throughout the OSPF routing
  9986.     domain.  The flooding  algorithm  is  reliable,  ensuring  that  all
  9987.     routers have the same collection of link state advertisements.  (See
  9988.     Section 13 for more information concerning the flooding  algorithm).
  9989.     This collection of advertisements is called the link state (or topo-
  9990.     logical) database.
  9991.  
  9992.     From the link state database, each router constructs a shortest path
  9993.     tree  with itself as root.  This yields a routing table (see Section
  9994.     11).  For the details of the routing table build process,  see  Sec-
  9995.     tion 16.
  9996.  
  9997.  
  9998.  
  9999.  
  10000.  
  10001.  
  10002.  
  10003.  
  10004.  
  10005.  
  10006.  
  10007.  
  10008.  
  10009.  
  10010.  
  10011.  
  10012.  
  10013.  
  10014.  
  10015.  
  10016.  
  10017.  
  10018.  
  10019.  
  10020.  
  10021.  
  10022.  
  10023.  
  10024. [Moy]                                                         [Page 179]
  10025.  
  10026. Internet Draft               OSPF Version 2                November 1992
  10027.  
  10028.  
  10029. A.4.1 The Link State Advertisement header
  10030.  
  10031.     All link state advertisements begin with a common  20  byte  header.
  10032.     This  header  contains  enough  information to uniquely identify the
  10033.     advertisement (LS type, Link  State  ID,  and  Advertising  Router).
  10034.     Multiple  instances of the link state advertisement may exist in the
  10035.     routing domain at the same time.  It is then necessary to  determine
  10036.     which  instance  is  more recent.  This is accomplished by examining
  10037.     the LS age, LS sequence number and LS checksum fields that are  also
  10038.     contained in the link state advertisement header.
  10039.  
  10040.  
  10041.         0                   1                   2                   3
  10042.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10043.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10044.        |            LS age             |    Options    |    LS type    |
  10045.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10046.        |                        Link State ID                          |
  10047.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10048.        |                     Advertising Router                        |
  10049.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10050.        |                     LS sequence number                        |
  10051.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10052.        |         LS checksum           |             length            |
  10053.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10054.  
  10055.  
  10056.  
  10057.     LS age
  10058.         The time in seconds since the link state advertisement was  ori-
  10059.         ginated.
  10060.  
  10061.     Options
  10062.         The optional capabilities supported by the described portion  of
  10063.         the routing domain.  OSPF's optional capabilities are documented
  10064.         in Section A.2.
  10065.  
  10066.     LS type
  10067.         The type of the link state advertisement.  Each link state  type
  10068.         has  a  separate advertisement format.  The link state types are
  10069.         as follows (see Section 12.1.3 for further explanation):
  10070.  
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080. [Moy]                                                         [Page 180]
  10081.  
  10082. Internet Draft               OSPF Version 2                November 1992
  10083.  
  10084.  
  10085.  
  10086.                         LS Type   Description
  10087.                         ___________________________________
  10088.                         1         Router links
  10089.                         2         Network links
  10090.                         3         Summary link (IP network)
  10091.                         4         Summary link (ASBR)
  10092.                         5         AS external link
  10093.  
  10094.  
  10095.  
  10096.  
  10097.     Link State ID
  10098.         This field identifies the portion of  the  internet  environment
  10099.         that  is  being described by the advertisement.  The contents of
  10100.         this field depend on the advertisement's LS type.  For  example,
  10101.         in  network links advertisements the Link State ID is set to the
  10102.         IP interface address of the network's  Designated  Router  (from
  10103.         which  the network's IP address can be derived).  The Link State
  10104.         ID is further discussed in Section 12.1.4.
  10105.  
  10106.     Advertising Router
  10107.         The Router ID of the  router  that  originated  the  link  state
  10108.         advertisement.   For  example,  in  network links advertisements
  10109.         this field is set to the Router ID of the  network's  Designated
  10110.         Router.
  10111.  
  10112.     LS sequence number
  10113.         Detects old or duplicate link state advertisements.   Successive
  10114.         instances  of a link state advertisement are given successive LS
  10115.         sequence numbers.  See Section 12.1.6 for more details.
  10116.  
  10117.     LS checksum
  10118.         The Fletcher checksum of the complete contents of the link state
  10119.         advertisement.  See Section 12.1.7 for more details.
  10120.  
  10121.     length
  10122.         The length in bytes  of  the  link  state  advertisement.   This
  10123.         includes the 20 byte link state header.
  10124.  
  10125.  
  10126.  
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136. [Moy]                                                         [Page 181]
  10137.  
  10138. Internet Draft               OSPF Version 2                November 1992
  10139.  
  10140.  
  10141. A.4.2 Router links advertisements
  10142.  
  10143.     Router links advertisements are the Type  1  link  state  advertise-
  10144.     ments.   Each router in an area originates a router links advertise-
  10145.     ment.  The  advertisement  describes  the  state  and  cost  of  the
  10146.     router's  links  (or  interfaces)  to the area.  All of the router's
  10147.     links to the area must be described in a single router links  adver-
  10148.     tisement.   For  details concerning the construction of router links
  10149.     advertisements, see Section 12.4.1.
  10150.  
  10151.     In router links advertisements, the Link State ID field  is  set  to
  10152.     the   router's   OSPF   Router   ID.    The  T-bit  is  set  in  the
  10153.     advertisement's Option field if and only if the router  is  able  to
  10154.     calculate  a  separate  set of routes for each IP TOS.  Router links
  10155.     advertisements are flooded throughout a single area only.
  10156.  
  10157.  
  10158.         0                   1                   2                   3
  10159.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10160.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10161.        |            LS age             |     Options   |       1       |
  10162.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10163.        |                        Link State ID                          |
  10164.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10165.        |                     Advertising Router                        |
  10166.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10167.        |                     LS sequence number                        |
  10168.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10169.        |         LS checksum           |             length            |
  10170.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10171.        |    0    |V|E|B|        0      |            # links            |
  10172.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10173.        |                          Link ID                              |
  10174.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10175.        |                         Link Data                             |
  10176.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10177.        |     Type      |     # TOS     |        TOS 0 metric           |
  10178.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10179.        |      TOS      |        0      |            metric             |
  10180.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10181.        |                              ...                              |
  10182.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10183.        |      TOS      |        0      |            metric             |
  10184.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10185.        |                          Link ID                              |
  10186.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10187.        |                         Link Data                             |
  10188.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10189.  
  10190.  
  10191.  
  10192. [Moy]                                                         [Page 182]
  10193.  
  10194. Internet Draft               OSPF Version 2                November 1992
  10195.  
  10196.  
  10197.        |                              ...                              |
  10198.  
  10199.  
  10200.  
  10201.     bit V
  10202.         When set, the router is an endpoint of an  active  virtual  link
  10203.         that is using the described area as a transit area.
  10204.  
  10205.     bit E
  10206.         When set, the router is an AS boundary router (E is  for  exter-
  10207.         nal)
  10208.  
  10209.     bit B
  10210.         When set, the router is an area border router (B is for border)
  10211.  
  10212.     # links
  10213.         The number of router  links  described  by  this  advertisement.
  10214.         This must be the total collection of router links to the area.
  10215.  
  10216.  
  10217.     The following fields are used to describe each  router  link.   Each
  10218.     router  link  is  typed  (see the below Type field).  The type field
  10219.     indicates the kind of link being described.  It may be a link  to  a
  10220.     transit network, to another router or to a stub network.  The values
  10221.     of all the other fields describing  a  router  link  depend  on  the
  10222.     link's  type.   For example, each link has an associated 32-bit data
  10223.     field.   For  links  to  stub  networks  this  field  specifies  the
  10224.     network's  IP  address mask.  For the other link types the Link Data
  10225.     specifies the router's associated IP interface address.
  10226.  
  10227.  
  10228.     Type
  10229.         A quick description of the router link.  One of  the  following.
  10230.         Note  that  host routes are classified as links to stub networks
  10231.         whose network mask is 0xffffffff.
  10232.  
  10233.  
  10234.  
  10235.                  Type   Description
  10236.                  __________________________________________________
  10237.                  1      Point-to-point connection to another router
  10238.                  2      Connection to a transit network
  10239.                  3      Connection to a stub network
  10240.                  4      Virtual link
  10241.  
  10242.  
  10243.  
  10244.  
  10245.  
  10246.  
  10247.  
  10248. [Moy]                                                         [Page 183]
  10249.  
  10250. Internet Draft               OSPF Version 2                November 1992
  10251.  
  10252.  
  10253.     Link ID
  10254.         Identifies the object that this router link connects to.   Value
  10255.         depends  on  the link's type.  When connecting to an object that
  10256.         also originates a link state advertisement (i.e., another router
  10257.         or  a  transit  network)  the  Link  ID  is  equal  to the other
  10258.         advertisement's Link State ID.  This provides the key for  look-
  10259.         ing  up said advertisement in the link state database.  See Sec-
  10260.         tion 12.2 for more details.
  10261.  
  10262.  
  10263.  
  10264.                        Type   Link ID
  10265.                        ______________________________________
  10266.                        1      Neighboring router's ID
  10267.                        2      IP address of Designated Router
  10268.                        3      IP network/subnet number
  10269.                        4      Neighboring router's ID
  10270.  
  10271.  
  10272.  
  10273.  
  10274.     Link Data
  10275.         Contents again depend on the link's Type field. For  connections
  10276.         to  stub  network, it specifies the network mask. For unnumbered
  10277.         point-to-point networks, it  specifies  the  interface's  MIB-II
  10278.         [RFC  1213] ifIndex value. For the other link types it specifies
  10279.         the router's associated IP interface address. This latter  piece
  10280.         of information is needed during the routing table build process,
  10281.         when calculating the IP address of the  next  hop.  See  Section
  10282.         16.1.1 for more details.
  10283.  
  10284.     #metrics
  10285.         The number of different TOS metrics given  for  this  link,  not
  10286.         counting  the  required  metric  for  TOS 0.  For example, if no
  10287.         additional TOS metrics are given, this field should be set to 0.
  10288.  
  10289.     TOS 0 metric
  10290.         The cost of using this router link for TOS 0.
  10291.  
  10292.  
  10293.     For each link, separate metrics may be specified for  each  Type  of
  10294.     Service  (TOS).   The  metric for TOS 0 must always be included, and
  10295.     was discussed above.  Metrics for non-zero TOS are described  below.
  10296.     The  encoding  of TOS in OSPF link state advertisements is described
  10297.     in Section 12.3.  Note that the cost for non-zero  TOS  values  that
  10298.     are  not  specified  defaults  to  the  TOS 0 cost.  Metrics must be
  10299.     listed in order of increasing TOS encoding.  For example, the metric
  10300.     for  TOS  16  must  always follow the metric for TOS 8 when both are
  10301.  
  10302.  
  10303.  
  10304. [Moy]                                                         [Page 184]
  10305.  
  10306. Internet Draft               OSPF Version 2                November 1992
  10307.  
  10308.  
  10309.     specified.
  10310.  
  10311.  
  10312.     TOS IP type of service that this metric refers to.  The encoding  of
  10313.         TOS  in  OSPF  link state advertisements is described in Section
  10314.         12.3.
  10315.  
  10316.     metric
  10317.         The cost of using this outbound router link, for traffic of  the
  10318.         specified TOS.
  10319.  
  10320.  
  10321.  
  10322.  
  10323.  
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.  
  10330.  
  10331.  
  10332.  
  10333.  
  10334.  
  10335.  
  10336.  
  10337.  
  10338.  
  10339.  
  10340.  
  10341.  
  10342.  
  10343.  
  10344.  
  10345.  
  10346.  
  10347.  
  10348.  
  10349.  
  10350.  
  10351.  
  10352.  
  10353.  
  10354.  
  10355.  
  10356.  
  10357.  
  10358.  
  10359.  
  10360. [Moy]                                                         [Page 185]
  10361.  
  10362. Internet Draft               OSPF Version 2                November 1992
  10363.  
  10364.  
  10365. A.4.3 Network links advertisements
  10366.  
  10367.     Network links advertisements are the Type 2  link  state  advertise-
  10368.     ments.  A network links advertisement is originated for each transit
  10369.     network in the area.  A transit network is  a  multi-access  network
  10370.     that  has  more  than one attached router.  The network links adver-
  10371.     tisement is originated by  the  network's  Designated  Router.   The
  10372.     advertisement describes all routers attached to the network, includ-
  10373.     ing the Designated Router itself.  The advertisement's Link State ID
  10374.     field lists the IP interface address of the Designated Router.
  10375.  
  10376.     The distance from the network to all attached routers is  zero,  for
  10377.     all  types  of  service.  This is why the TOS and metric fields need
  10378.     not be specified in the network links  advertisement.   For  details
  10379.     concerning  the  construction  of  network links advertisements, see
  10380.     Section 12.4.2.
  10381.  
  10382.  
  10383.         0                   1                   2                   3
  10384.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10385.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10386.        |            LS age             |      Options  |      2        |
  10387.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10388.        |                        Link State ID                          |
  10389.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10390.        |                     Advertising Router                        |
  10391.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10392.        |                     LS sequence number                        |
  10393.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10394.        |         LS checksum           |             length            |
  10395.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10396.        |                         Network Mask                          |
  10397.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10398.        |                        Attached Router                        |
  10399.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10400.        |                              ...                              |
  10401.  
  10402.  
  10403.  
  10404.     Network Mask
  10405.         The IP address mask for the network.  For  example,  a  class  A
  10406.         network would have the mask 0xff000000.
  10407.  
  10408.     Attached Router
  10409.         The Router IDs of each of the routers attached to  the  network.
  10410.         Actually,  only  those  routers  that  are fully adjacent to the
  10411.         Designated Router are listed.  The  Designated  Router  includes
  10412.         itself  in  this  list.   The  number of routers included can be
  10413.  
  10414.  
  10415.  
  10416. [Moy]                                                         [Page 186]
  10417.  
  10418. Internet Draft               OSPF Version 2                November 1992
  10419.  
  10420.  
  10421.         deduced from the link state advertisement's length field.
  10422.  
  10423.  
  10424.  
  10425.  
  10426.  
  10427.  
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436.  
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.  
  10451.  
  10452.  
  10453.  
  10454.  
  10455.  
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.  
  10463.  
  10464.  
  10465.  
  10466.  
  10467.  
  10468.  
  10469.  
  10470.  
  10471.  
  10472. [Moy]                                                         [Page 187]
  10473.  
  10474. Internet Draft               OSPF Version 2                November 1992
  10475.  
  10476.  
  10477. A.4.4 Summary link advertisements
  10478.  
  10479.     Summary link advertisements are the Type 3 and 4 link  state  adver-
  10480.     tisements.   These  advertisements  are  originated  by  area border
  10481.     routers.  A separate summary link advertisement  is  made  for  each
  10482.     destination  (known  to  the router) which belongs to the AS, yet is
  10483.     outside the area.  For details concerning the construction  of  sum-
  10484.     mary link advertisements, see Section 12.4.3.
  10485.  
  10486.     Type 3 link state advertisements are used when the destination is an
  10487.     IP network.  In this case the advertisement's Link State ID field is
  10488.     an IP network number (if necessary, the Link State ID can also  have
  10489.     one  or  more  of  the network's "host" bits set; see Appendix F for
  10490.     details). When the destination is an AS boundary router,  a  Type  4
  10491.     advertisement  is  used, and the Link State ID field is the AS boun-
  10492.     dary router's OSPF Router ID.  (To see why it is necessary to adver-
  10493.     tise  the  location of each ASBR, consult Section 16.4.)  Other than
  10494.     the difference in the Link State ID field, the format of Type 3  and
  10495.     4 link state advertisements is identical.
  10496.  
  10497.     For stub areas, type 3 summary link advertisements can also be  used
  10498.     to  describe a (per-area) default route.  Default summary routes are
  10499.     used in stub areas instead of flooding a complete  set  of  external
  10500.     routes.     When   describing   a   default   summary   route,   the
  10501.     advertisement's Link State ID is always  set  to  DefaultDestination
  10502.     (0.0.0.0) and the Network Mask is set to 0.0.0.0.
  10503.  
  10504.     Separate costs may be advertised for each IP Type of  Service.   The
  10505.     encoding  of  TOS  in OSPF link state advertisements is described in
  10506.     Section 12.3.  Note that the cost for TOS 0 must be included, and is
  10507.     always  listed  first.  If the T-bit is reset in the advertisement's
  10508.     Option field, only a route for TOS 0 is described by the  advertise-
  10509.     ment.    Otherwise,  routes  for  the  other  TOS  values  are  also
  10510.     described; if a cost for a certain TOS is  not  included,  its  cost
  10511.     defaults to that specified for TOS 0.
  10512.  
  10513.  
  10514.         0                   1                   2                   3
  10515.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10516.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10517.        |            LS age             |     Options   |    3 or 4     |
  10518.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10519.        |                        Link State ID                          |
  10520.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10521.        |                     Advertising Router                        |
  10522.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10523.        |                     LS sequence number                        |
  10524.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10525.  
  10526.  
  10527.  
  10528. [Moy]                                                         [Page 188]
  10529.  
  10530. Internet Draft               OSPF Version 2                November 1992
  10531.  
  10532.  
  10533.        |         LS checksum           |             length            |
  10534.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10535.        |                         Network Mask                          |
  10536.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10537.        |     TOS       |                  metric                       |
  10538.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10539.        |                              ...                              |
  10540.  
  10541.  
  10542.  
  10543.     Network Mask
  10544.         For  Type  3  link  state  advertisements,  this  indicates  the
  10545.         destination's  IP  network  mask.  For example, when advertising
  10546.         the location of a class A network the value 0xff000000 would  be
  10547.         used.   This field is not meaningful and must be zero for Type 4
  10548.         link state advertisements.
  10549.  
  10550.  
  10551.     For each  specified  type  of  service,  the  following  fields  are
  10552.     defined.   The  number of TOS routes included can be calculated from
  10553.     the link state advertisement's length field.  Values for TOS 0  must
  10554.     be specified; they are listed first.  Other values must be listed in
  10555.     order of increasing TOS encoding.  For example, the cost for TOS  16
  10556.     must always follow the cost for TOS 8 when both are specified.
  10557.  
  10558.  
  10559.     TOS The Type of Service  that  the  following  cost  concerns.   The
  10560.         encoding  of  TOS in OSPF link state advertisements is described
  10561.         in Section 12.3.
  10562.  
  10563.     metric
  10564.         The cost of this route.  Expressed in  the  same  units  as  the
  10565.         interface costs in the router links advertisements.
  10566.  
  10567.  
  10568.  
  10569.  
  10570.  
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584. [Moy]                                                         [Page 189]
  10585.  
  10586. Internet Draft               OSPF Version 2                November 1992
  10587.  
  10588.  
  10589. A.4.5 AS external link advertisements
  10590.  
  10591.     AS external link advertisements are the Type 5 link state advertise-
  10592.     ments.   These advertisements are originated by AS boundary routers.
  10593.     A separate advertisement is made for each destination (known to  the
  10594.     router)  which  is  external  to the AS.  For details concerning the
  10595.     construction of AS external link advertisements, see Section 12.4.3.
  10596.  
  10597.     AS external link advertisements usually describe a particular exter-
  10598.     nal  destination.   For these advertisements the Link State ID field
  10599.     specifies an IP network number (if necessary, the Link State ID  can
  10600.     also have one or more of the network's "host" bits set; see Appendix
  10601.     F for details).  AS external link advertisements are  also  used  to
  10602.     describe  a default route.  Default routes are used when no specific
  10603.     route exists to the destination.  When describing a  default  route,
  10604.     the  Link State ID is always set to DefaultDestination (0.0.0.0) and
  10605.     the Network Mask is set to 0.0.0.0.
  10606.  
  10607.     Separate costs may be advertised for each IP Type of  Service.   The
  10608.     encoding  of  TOS  in OSPF link state advertisements is described in
  10609.     Section 12.3.  Note that the cost for TOS 0 must be included, and is
  10610.     always  listed  first.  If the T-bit is reset in the advertisement's
  10611.     Option field, only a route for TOS 0 is described by the  advertise-
  10612.     ment.    Otherwise,  routes  for  the  other  TOS  values  are  also
  10613.     described; if a cost for a certain TOS is  not  included,  its  cost
  10614.     defaults to that specified for TOS 0.
  10615.  
  10616.  
  10617.         0                   1                   2                   3
  10618.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10619.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10620.        |            LS age             |     Options   |      5        |
  10621.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10622.        |                        Link State ID                          |
  10623.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10624.        |                     Advertising Router                        |
  10625.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10626.        |                     LS sequence number                        |
  10627.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10628.        |         LS checksum           |             length            |
  10629.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10630.        |                         Network Mask                          |
  10631.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10632.        |E|    TOS      |                  metric                       |
  10633.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10634.        |                      Forwarding address                       |
  10635.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10636.        |                      External Route Tag                       |
  10637.  
  10638.  
  10639.  
  10640. [Moy]                                                         [Page 190]
  10641.  
  10642. Internet Draft               OSPF Version 2                November 1992
  10643.  
  10644.  
  10645.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10646.        |                              ...                              |
  10647.  
  10648.  
  10649.  
  10650.     Network Mask
  10651.         The IP network mask for the advertised destination.   For  exam-
  10652.         ple,  when  advertising  a  class  A network the mask 0xff000000
  10653.         would be used.
  10654.  
  10655.  
  10656.     For each  specified  type  of  service,  the  following  fields  are
  10657.     defined.   The  number of TOS routes included can be calculated from
  10658.     the link state advertisement's length field.  Values for TOS 0  must
  10659.     be specified; they are listed first.  Other values must be listed in
  10660.     order of increasing TOS encoding.  For example, the cost for TOS  16
  10661.     must always follow the cost for TOS 8 when both are specified.
  10662.  
  10663.  
  10664.     bit E
  10665.         The type of external metric.  If bit E is set, the metric speci-
  10666.         fied is a Type 2 external metric.  This means the metric is con-
  10667.         sidered larger than any link state path.  If bit E is zero,  the
  10668.         specified  metric  is a Type 1 external metric.  This means that
  10669.         is is comparable directly  (without  translation)  to  the  link
  10670.         state metric.
  10671.  
  10672.     Forwarding address
  10673.         Data traffic for the advertised destination will be forwarded to
  10674.         this address.  If the Forwarding address is set to 0.0.0.0, data
  10675.         traffic will be forwarded instead to the advertisement's  origi-
  10676.         nator (i.e., the responsible AS boundary router).
  10677.  
  10678.     TOS The Type of Service  that  the  following  cost  concerns.   The
  10679.         encoding  of  TOS in OSPF link state advertisements is described
  10680.         in Section 12.3.
  10681.  
  10682.     metric
  10683.         The cost of this route.  Interpretation depends on the  external
  10684.         type indication (bit E above).
  10685.  
  10686.     External Route Tag
  10687.         A 32-bit field attached to each external  route.   This  is  not
  10688.         used by the OSPF protocol itself.  It may be used to communicate
  10689.         information between AS boundary routers; the precise  nature  of
  10690.         such information is outside the scope of this specification.
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696. [Moy]                                                         [Page 191]
  10697.  
  10698. Internet Draft               OSPF Version 2                November 1992
  10699.  
  10700.  
  10701. B. Architectural Constants
  10702.  
  10703.     Several OSPF protocol parameters have  fixed  architectural  values.
  10704.     These  parameters have been referred to in the text by names such as
  10705.     LSRefreshTimer.  The same naming convention is used for  the  confi-
  10706.     gurable protocol parameters.  They are defined in appendix C.
  10707.  
  10708.     The name of each architectural constant follows, together  with  its
  10709.     value and a short description of its function.
  10710.  
  10711.  
  10712.     LSRefreshTime
  10713.         The maximum time between distinct originations of any particular
  10714.         link  state  advertisement.   For  each link state advertisement
  10715.         that a router originates, an interval timer  should  be  set  to
  10716.         this  value.   Firing of this timer causes a new instance of the
  10717.         link  state  advertisement  to  be  originated.   The  value  of
  10718.         LSRefreshTime is set to 30 minutes.
  10719.  
  10720.     MinLSInterval
  10721.         The minimum time between distinct originations of any particular
  10722.         link  state advertisement.  The value of MinLSInterval is set to
  10723.         5 seconds.
  10724.  
  10725.     MaxAge
  10726.         The maximum age that a  link  state  advertisement  can  attain.
  10727.         When an advertisement's age reaches MaxAge, it is reflooded.  It
  10728.         is then removed from the database as soon as this flood is  ack-
  10729.         nowledged,  i.e., as soon as it has been removed from all neigh-
  10730.         bor Link state retransmission lists.  Advertisements having  age
  10731.         MaxAge are not used in the routing table calculation.  The value
  10732.         of MaxAge must be greater than LSRefreshTime.  The value of Max-
  10733.         Age is set to 1 hour.
  10734.  
  10735.     CheckAge
  10736.         When the age of a link state advertisement (that is contained in
  10737.         the  link  state  database)  hits  a  multiple  of CheckAge, the
  10738.         advertisement's checksum is verified.  An incorrect checksum  at
  10739.         this  time  indicates a serious error.  The value of CheckAge is
  10740.         set to 5 minutes.
  10741.  
  10742.     MaxAgeDiff
  10743.         The maximum time dispersion that can  occur,  as  a  link  state
  10744.         advertisement  is  flooded throughout the AS.  Most of this time
  10745.         is accounted for by the link  state  advertisements  sitting  on
  10746.         router output queues (and therefore not aging) during the flood-
  10747.         ing process.  The value of MaxAgeDiff is set to 15 minutes.
  10748.  
  10749.  
  10750.  
  10751.  
  10752. [Moy]                                                         [Page 192]
  10753.  
  10754. Internet Draft               OSPF Version 2                November 1992
  10755.  
  10756.  
  10757.     LSInfinity
  10758.         The metric value indicating that the destination described by  a
  10759.         link  state  advertisement  is unreachable. Used in summary link
  10760.         advertisements and AS external link advertisements as an  alter-
  10761.         native  to  premature aging (see Section 14.1). It is defined to
  10762.         be the 24-bit binary value of all ones: 0xffffff.
  10763.  
  10764.     DefaultDestination
  10765.         The Destination ID that indicates the default route.  This route
  10766.         is used when no other matching routing table entry can be found.
  10767.         The default destination can only be advertised  in  AS  external
  10768.         link  advertisements  and  in  stub  areas'  type 3 summary link
  10769.         advertisements.  Its value is the IP address 0.0.0.0.
  10770.  
  10771.  
  10772.  
  10773.  
  10774.  
  10775.  
  10776.  
  10777.  
  10778.  
  10779.  
  10780.  
  10781.  
  10782.  
  10783.  
  10784.  
  10785.  
  10786.  
  10787.  
  10788.  
  10789.  
  10790.  
  10791.  
  10792.  
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808. [Moy]                                                         [Page 193]
  10809.  
  10810. Internet Draft               OSPF Version 2                November 1992
  10811.  
  10812.  
  10813. C. Configurable Constants
  10814.  
  10815.     The OSPF protocol has quite a few  configurable  parameters.   These
  10816.     parameters  are  listed  below.  They are grouped into general func-
  10817.     tional categories (area  parameters,  interface  parameters,  etc.).
  10818.     Sample values are given for some of the parameters.
  10819.  
  10820.     Some parameter settings  need  to  be  consistent  among  groups  of
  10821.     routers.   For  example,  all  routers in an area must agree on that
  10822.     area's parameters, and all routers attached to a network must  agree
  10823.     on that network's IP network number and mask.
  10824.  
  10825.     Some parameters may be determined by router  algorithms  outside  of
  10826.     this  specification  (e.g.,  the  address of a host connected to the
  10827.     router via a SLIP line).  From OSPF's point of view, these items are
  10828.     still configurable.
  10829.  
  10830.     C.1 Global parameters
  10831.  
  10832.         In general, a separate copy of the OSPF protocol is run for each
  10833.         area.   Because  of  this,  most  configuration  parameters  are
  10834.         defined on a  per-area  basis.   The  few  global  configuration
  10835.         parameters are listed below.
  10836.  
  10837.  
  10838.         Router ID
  10839.             This is a 32-bit number that uniquely identifies the  router
  10840.             in  the  Autonomous  System.   One  algorithm  for Router ID
  10841.             assignment is to choose the largest or smallest  IP  address
  10842.             assigned  to  the  router.   If a router's OSPF Router ID is
  10843.             changed, the router's  OSPF  software  should  be  restarted
  10844.             before the new Router ID takes effect.
  10845.  
  10846.         TOS capability
  10847.             This  item  indicates  whether  the  router  will  calculate
  10848.             separate  routes  based  on  TOS.  For more information, see
  10849.             Sections 4.5 and 16.9.
  10850.  
  10851.     C.2 Area parameters
  10852.  
  10853.         All routers belonging to an area must agree on that area's  con-
  10854.         figuration.   Disagreements  between two routers will lead to an
  10855.         inability for adjacencies to form between them, with a resulting
  10856.         hindrance to the flow of routing protocol and data traffic.  The
  10857.         following items must be configured for an area:
  10858.  
  10859.  
  10860.  
  10861.  
  10862.  
  10863.  
  10864. [Moy]                                                         [Page 194]
  10865.  
  10866. Internet Draft               OSPF Version 2                November 1992
  10867.  
  10868.  
  10869.         Area ID
  10870.             This is a 32-bit number that identifies the area.  The  Area
  10871.             ID  of  0  is  reserved  for  the  backbone.   If  the  area
  10872.             represents a subnetted network, the IP network number of the
  10873.             subnetted network may be used for the Area ID.
  10874.  
  10875.         List of address ranges
  10876.             An OSPF area is defined as a list of  address  ranges.  Each
  10877.             address range consists of the following items:
  10878.  
  10879.             [IP address, mask]
  10880.                     Describes the collection of IP  addresses  contained
  10881.                     in   the  address  range.  Networks  and  hosts  are
  10882.                     assigned to  an  area  depending  on  whether  their
  10883.                     addresses  fall  into  one  of  the  area's defining
  10884.                     address ranges.  Routers are viewed as belonging  to
  10885.                     multiple  areas,  depending  on  their attached net-
  10886.                     works' area membership.
  10887.  
  10888.             [Status]
  10889.                     Set to either Advertise or DoNotAdvertise.   Routing
  10890.                     information  is condensed at area boundaries. Exter-
  10891.                     nal to the area, at most a single  route  is  adver-
  10892.                     tised  for  each  address range. The route is adver-
  10893.                     tised if and only if the address range's  Status  is
  10894.                     set  to  Advertise.   Unadvertised  ranges allow the
  10895.                     existence of certain networks  to  be  intentionally
  10896.                     hidden  from other areas. Status is set to Advertise
  10897.                     by default.
  10898.  
  10899.             As an example, suppose an IP subnetted network is to be  its
  10900.             own  OSPF  area.   The  area would be configured as a single
  10901.             address range, whose IP address is the address of  the  sub-
  10902.             netted network, and whose mask is the natural class A, B, or
  10903.             C internet mask.  A single route would be advertised  exter-
  10904.             nal to the area, describing the entire subnetted network.
  10905.  
  10906.         Authentication type
  10907.             Each area can be configured for a separate type of authenti-
  10908.             cation.   See  Appendix  D  for  a discussion of the defined
  10909.             authentication types.
  10910.  
  10911.         External routing capability
  10912.             Whether  AS  external   advertisements   will   be   flooded
  10913.             into/throughout the area.  If AS external advertisements are
  10914.             excluded from the area, the area is called a "stub".  Inter-
  10915.             nal  to stub areas, routing to external destinations will be
  10916.             based solely on  a  default  summary  route.   The  backbone
  10917.  
  10918.  
  10919.  
  10920. [Moy]                                                         [Page 195]
  10921.  
  10922. Internet Draft               OSPF Version 2                November 1992
  10923.  
  10924.  
  10925.             cannot  be  configured  as a stub area.  Also, virtual links
  10926.             cannot be configured through stub areas.  For more  informa-
  10927.             tion, see Section 3.6.
  10928.  
  10929.         StubDefaultCost
  10930.             If the area has been configured as  a  stub  area,  and  the
  10931.             router  itself  is  an  area border router, then the StubDe-
  10932.             faultCost indicates the cost of  the  default  summary  link
  10933.             that  the  router should advertise into the area.  There can
  10934.             be a separate cost configured for each IP TOS.  See  Section
  10935.             12.4.3 for more information.
  10936.  
  10937.     C.3 Router interface parameters
  10938.  
  10939.         Some of the configurable router interface parameters (such as IP
  10940.         interface  address and subnet mask) actually imply properties of
  10941.         the attached networks, and therefore must be  consistent  across
  10942.         all  the  routers attached to that network.  The parameters that
  10943.         must be configured for a router interface are:
  10944.  
  10945.  
  10946.         IP interface address
  10947.             The IP protocol address for this interface.   This  uniquely
  10948.             identifies  the  router  over  the  entire  internet.  An IP
  10949.             address is not required on serial lines.  Such a serial line
  10950.             is called "unnumbered".
  10951.  
  10952.         IP interface mask
  10953.             This  denotes  the  portion  of  the  IP  interface  address
  10954.             that  identifies   the  attached  network.   This  is  often
  10955.             referred  to  as  the subnet  mask.
  10956.  
  10957.         Interface output cost(s)
  10958.             The cost of sending a packet on the interface, expressed  in
  10959.             the  link state metric.  This is advertised as the link cost
  10960.             for this interface in the router's router  links  advertise-
  10961.             ment.  There may be a separate cost for each IP Type of Ser-
  10962.             vice.  The interface output cost(s) must always  be  greater
  10963.             than 0.
  10964.  
  10965.         RxmtInterval
  10966.             The number  of  seconds  between  link  state  advertisement
  10967.             retransmissions,  for  adjacencies  belonging to this inter-
  10968.             face.  Also used when  retransmitting  Database  Description
  10969.             and  Link  State  Request Packets.  This should be well over
  10970.             the expected round-trip delay between any two routers on the
  10971.             attached  network.  The setting of this value should be con-
  10972.             servative or needless retransmissions will result.  It  will
  10973.  
  10974.  
  10975.  
  10976. [Moy]                                                         [Page 196]
  10977.  
  10978. Internet Draft               OSPF Version 2                November 1992
  10979.  
  10980.  
  10981.             need  to  be  larger  on  low speed serial lines and virtual
  10982.             links.  Sample value for a local area network: 5 seconds.
  10983.  
  10984.         InfTransDelay
  10985.             The estimated number of seconds it takes to transmit a  Link
  10986.             State  Update Packet over this interface.  Link state adver-
  10987.             tisements contained in the update packet must have their age
  10988.             incremented  by this amount before transmission.  This value
  10989.             should take into account the  transmission  and  propagation
  10990.             delays  for the interface.  It must be greater than 0.  Sam-
  10991.             ple value for a local area network: 1 second.
  10992.  
  10993.         Router Priority
  10994.             An 8-bit unsigned integer.  When two routers attached  to  a
  10995.             network  both  attempt  to become Designated Router, the one
  10996.             with the highest Router Priority takes precedence.  If there
  10997.             is  still a tie, the router with the highest Router ID takes
  10998.             precedence.  A router whose Router Priority is set to  0  is
  10999.             ineligible  to become Designated Router on the attached net-
  11000.             work.  Router Priority is only configured for interfaces  to
  11001.             multi-access networks.
  11002.  
  11003.         HelloInterval
  11004.             The length of time, in seconds, between  the  Hello  packets
  11005.             that  the  router  sends  on  the  interface.  This value is
  11006.             advertised in the router's Hello packets.  It  must  be  the
  11007.             same  for  all  routers  attached  to a common network.  The
  11008.             smaller the hello interval, the faster  topological  changes
  11009.             will be detected, but more routing traffic will ensue.  Sam-
  11010.             ple value for a X.25 PDN network: 30 seconds.  Sample  value
  11011.             for a local area network: 10 seconds.
  11012.  
  11013.         RouterDeadInterval
  11014.             The number of seconds that a router's Hellos have  not  been
  11015.             seen  before its neighbors declare the router down.  This is
  11016.             also advertised in the router's Hello Packets in the DeadInt
  11017.             field.   This  should  be some multiple of the HelloInterval
  11018.             (say 4).  This value again must be the same for all  routers
  11019.             attached to a common network.
  11020.  
  11021.         Authentication key
  11022.             This configured data allows the authentication procedure  to
  11023.             generate  and/or verify the authentication field in the OSPF
  11024.             header.  This value again must be the same for  all  routers
  11025.             attached to a common network.  For example, if the authenti-
  11026.             cation type indicates simple  password,  the  authentication
  11027.             key  would  be a 64-bit password. This key would be inserted
  11028.             directly into  the  OSPF  header  when  originating  routing
  11029.  
  11030.  
  11031.  
  11032. [Moy]                                                         [Page 197]
  11033.  
  11034. Internet Draft               OSPF Version 2                November 1992
  11035.  
  11036.  
  11037.             protocol  packets.   There  could be a separate password for
  11038.             each network.
  11039.  
  11040.     C.4 Virtual link parameters
  11041.  
  11042.         Virtual links are used to restore/increase connectivity  of  the
  11043.         backbone.   Virtual  links may be configured between any pair of
  11044.         area border routers having interfaces to a common (non-backbone)
  11045.         area.   The virtual link appears as an unnumbered point-to-point
  11046.         link in the graph for the backbone.  The virtual  link  must  be
  11047.         configured in both of the area border routers.
  11048.  
  11049.         A virtual link appears in router links advertisements  (for  the
  11050.         backbone) as if it were a separate router interface to the back-
  11051.         bone.  As such, it has all of the parameters associated  with  a
  11052.         router  interface  (see  Section  C.3).  Although a virtual link
  11053.         acts like an unnumbered point-to-point link,  it  does  have  an
  11054.         associated IP interface address.  This address is used as the IP
  11055.         source in protocol packets it sends along the virtual link,  and
  11056.         is  set  dynamically  during  the  routing  table build process.
  11057.         Interface output cost is also set dynamically on  virtual  links
  11058.         to  be  the cost of the intra-area path between the two routers.
  11059.         The parameter RxmtInterval must be  configured,  and  should  be
  11060.         well over the expected round-trip delay between the two routers.
  11061.         This may be hard to estimate for a virtual link.  It  is  better
  11062.         to  err  on the side of making it too large.  Router Priority is
  11063.         not used on virtual links.
  11064.  
  11065.         A virtual link is defined  by  the  following  two  configurable
  11066.         parameters:  the Router ID of the virtual link's other endpoint,
  11067.         and the (non-backbone) area through which the virtual link  runs
  11068.         (referred to as the virtual link's transit area).  Virtual links
  11069.         cannot be configured through stub areas.
  11070.  
  11071.     C.5 Non-broadcast, multi-access network parameters
  11072.  
  11073.         OSPF treats a non-broadcast, multi-access network much  like  it
  11074.         treats  a  broadcast  network.   Since there may be many routers
  11075.         attached to the network, a Designated Router is selected for the
  11076.         network.   This  Designated  Router  then  originates a networks
  11077.         links advertisement, which lists all  routers  attached  to  the
  11078.         non-broadcast network.
  11079.  
  11080.         However, due to the lack of broadcast capabilities, it is neces-
  11081.         sary  to  use  configuration parameters in the Designated Router
  11082.         selection.  These parameters need only be  configured  in  those
  11083.         routers that are themselves eligible to become Designated Router
  11084.         (i.e., those router's whose DR Priority for the network is  non-
  11085.  
  11086.  
  11087.  
  11088. [Moy]                                                         [Page 198]
  11089.  
  11090. Internet Draft               OSPF Version 2                November 1992
  11091.  
  11092.  
  11093.         zero):
  11094.  
  11095.  
  11096.         List of all other attached routers
  11097.             The list of all other routers attached to the  non-broadcast
  11098.             network.   Each router is listed by its IP interface address
  11099.             on the network.  Also, for each router listed, that router's
  11100.             eligibility  to  become  Designated  Router must be defined.
  11101.             When an interface to a non-broadcast network comes  up,  the
  11102.             router  sends Hello packets only to those neighbors eligible
  11103.             to become Designated  Router,  until  the  identity  of  the
  11104.             Designated Router is discovered.
  11105.  
  11106.         PollInterval
  11107.             If a neighboring router has become inactive (hellos have not
  11108.             been  seen  for RouterDeadInterval seconds), it may still be
  11109.             necessary to send Hellos to the dead neighbor.  These Hellos
  11110.             will  be sent at the reduced rate PollInterval, which should
  11111.             be much larger than HelloInterval.  Sample value for  a  PDN
  11112.             X.25 network: 2 minutes.
  11113.  
  11114.     C.6 Host route parameters
  11115.  
  11116.         Host routes are advertised in  router  links  advertisements  as
  11117.         stub networks with mask 0xffffffff.  They indicate either router
  11118.         interfaces to point-to-point networks, looped router interfaces,
  11119.         or IP hosts that are directly connected to the router (e.g., via
  11120.         a SLIP line).  For each host directly connected to  the  router,
  11121.         the following items must be configured:
  11122.  
  11123.  
  11124.         Host IP address
  11125.             The IP address of the host.
  11126.  
  11127.         Cost of link to host
  11128.             The cost of sending a packet to the host, in  terms  of  the
  11129.             link  state metric.  There may be multiple costs configured,
  11130.             one for each IP TOS.  However, since the host  probably  has
  11131.             only a single connection to the internet, the actual config-
  11132.             ured cost(s) in many cases is unimportant (i.e.,  will  have
  11133.             no effect on routing).
  11134.  
  11135.  
  11136.  
  11137.  
  11138.  
  11139.  
  11140.  
  11141.  
  11142.  
  11143.  
  11144. [Moy]                                                         [Page 199]
  11145.  
  11146. Internet Draft               OSPF Version 2                November 1992
  11147.  
  11148.  
  11149. D. Authentication
  11150.  
  11151.     All OSPF protocol exchanges  are  authenticated.   The  OSPF  packet
  11152.     header  (see  Section  A.3.1) includes an authentication type field,
  11153.     and 64-bits of data for use by the appropriate authentication scheme
  11154.     (determined by the type field).
  11155.  
  11156.     The authentication type is configurable on a per-area basis.   Addi-
  11157.     tional authentication data is configurable on a per-interface basis.
  11158.     For example, if an area uses a simple password scheme for  authenti-
  11159.     cation,  a separate password may be configured for each network con-
  11160.     tained in the area.
  11161.  
  11162.     Authentication types 0 and 1 are defined by this specification.  All
  11163.     other  authentication  types are reserved for definition by the IANA
  11164.     (iana@ISI.EDU).   The  current  list  of  authentication  types   is
  11165.     described below in Table 20.
  11166.  
  11167.  
  11168.  
  11169.                   AuType       Description
  11170.                   ___________________________________________
  11171.                   0            No authentication
  11172.                   1            Simple password
  11173.                   All others   Reserved for assignment by the
  11174.                                IANA (iana@ISI.EDU)
  11175.  
  11176.  
  11177.                       Table 20: OSPF authentication types.
  11178.  
  11179.  
  11180.  
  11181.     D.1 Autype 0 -- No authentication
  11182.  
  11183.         Use of this authentication type means that routing exchanges  in
  11184.         the  area  are  not authenticated.  The 64-bit field in the OSPF
  11185.         header can contain anything; it is not examined on packet recep-
  11186.         tion.
  11187.  
  11188.     D.2 Autype 1 -- Simple password
  11189.  
  11190.         Using this authentication type, a 64-bit field is configured  on
  11191.         a  per-network  basis.  All packets sent on a particular network
  11192.         must have this configured value  in  their  OSPF  header  64-bit
  11193.         authentication  field.  This essentially serves as a "clear" 64-
  11194.         bit password.
  11195.  
  11196.  
  11197.  
  11198.  
  11199.  
  11200. [Moy]                                                         [Page 200]
  11201.  
  11202. Internet Draft               OSPF Version 2                November 1992
  11203.  
  11204.  
  11205.         This guards against  routers  inadvertently  joining  the  area.
  11206.         They  must  first  be  configured  with their attached networks'
  11207.         passwords before they can participate in the routing domain.
  11208.  
  11209.  
  11210.  
  11211.  
  11212.  
  11213.  
  11214.  
  11215.  
  11216.  
  11217.  
  11218.  
  11219.  
  11220.  
  11221.  
  11222.  
  11223.  
  11224.  
  11225.  
  11226.  
  11227.  
  11228.  
  11229.  
  11230.  
  11231.  
  11232.  
  11233.  
  11234.  
  11235.  
  11236.  
  11237.  
  11238.  
  11239.  
  11240.  
  11241.  
  11242.  
  11243.  
  11244.  
  11245.  
  11246.  
  11247.  
  11248.  
  11249.  
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.  
  11256. [Moy]                                                         [Page 201]
  11257.  
  11258. Internet Draft               OSPF Version 2                November 1992
  11259.  
  11260.  
  11261. E. Differences from RFC 1247
  11262.  
  11263.     This section documents the differences between  this  memo  and  RFC
  11264.     1247.   These differences include a fix for a problem involving OSPF
  11265.     virtual links, together with minor enhancements  and  clarifications
  11266.     to  the protocol. All differences are backward-compatible. Implemen-
  11267.     tations of this memo and of RFC 1247 will interoperate.
  11268.  
  11269.     E.1 A fix for a problem with OSPF Virtual links
  11270.  
  11271.         In RFC 1247, certain configurations of OSPF  virtual  links  can
  11272.         cause routing loops. The root of the problem is that while there
  11273.         is an information mismatch at the boundary of any virtual link's
  11274.         transit  area, a backbone path can still cross the boundary. RFC
  11275.         1247 attempted to compensate for this  information  mismatch  by
  11276.         adjusting  any  backbone path as it enters the transit area (see
  11277.         Section 16.3 in RFC  1247).  However,  this  proved  not  to  be
  11278.         enough.  This  memo  fixes the problem by having all area border
  11279.         routers determine, by looking at summary links,  whether  better
  11280.         backbone paths can be found through the transit areas.
  11281.  
  11282.         This fix simplifies the OSPF virtual link logic, and consists of
  11283.         the following components:
  11284.  
  11285.         o   A new bit has been defined in the  router  links  advertise-
  11286.             ment,  called bit V. Bit V is set in a router's router links
  11287.             advertisement for Area A if and only if  the  router  is  an
  11288.             endpoint  of  an active virtual link that uses Area A as its
  11289.             transit area (see Sections 12.4.1 and A.4.2).  This  enables
  11290.             the other routers attached to Area A to discover whether the
  11291.             area supports any virtual links (i.e., is a  transit  area).
  11292.             This  discovery  is  done during the calculation of Area A's
  11293.             shortest-path tree (see Section 16.1).
  11294.  
  11295.         o   To aid in the description of the algorithm, a new  parameter
  11296.             has  been added to the OSPF area structure: Transit capabil-
  11297.             ity. This parameter indicates whether the area supports  any
  11298.             active virtual links. Equivalently, it indicates whether the
  11299.             area can carry traffic  that  neither  originates  nor  ter-
  11300.             minates in the area itself.
  11301.  
  11302.         o   The calculation  in  Section  16.3  of  RFC  1247  has  been
  11303.             replaced.  The  new  calculation,  performed  by area border
  11304.             routers only, examines the summary links  belonging  to  all
  11305.             attached  transit areas to see whether the transit areas can
  11306.             provide better paths than those already  found  in  Sections
  11307.             16.1 and 16.2.
  11308.  
  11309.  
  11310.  
  11311.  
  11312. [Moy]                                                         [Page 202]
  11313.  
  11314. Internet Draft               OSPF Version 2                November 1992
  11315.  
  11316.  
  11317.         o   The incremental  calculations  in  Section  16.5  have  been
  11318.             updated as a result of the new calculations in Section 16.3.
  11319.  
  11320.     E.2 Supporting supernetting and subnet 0
  11321.  
  11322.         In RFC 1247, an OSPF router cannot originate separate AS  exter-
  11323.         nal  link  advertisements  (or  separate summary link advertise-
  11324.         ments) for two networks that have the same address but different
  11325.         masks.  This  situation can arise when subnet 0 of a network has
  11326.         been assigned (a practice that  is  generally  discouraged),  or
  11327.         when  using  supernetting as described in [RFC 1338] (a practice
  11328.         that is generally encouraged  to  reduce  the  size  of  routing
  11329.         tables),  or even when in transition from one mask to another on
  11330.         a subnet.  Using supernetting as an example, you might  want  to
  11331.         aggregate   the   four  class  C  networks  192.9.4.0-192.9.7.0,
  11332.         advertising one route for the aggregation and  another  for  the
  11333.         single class C network 192.9.4.0.
  11334.  
  11335.         The reason behind this limitation is that in RFC 1247, the  Link
  11336.         State  ID  of  AS  external link advertisements and summary link
  11337.         advertisements is set equal to the described network's  address.
  11338.         In  the above example, RFC 1247 would assign both advertisements
  11339.         the Link State ID of 192.9.4.0, making them in essence the  same
  11340.         advertisement.  This memo fixes the problem by relaxing the set-
  11341.         ting of the Link State ID so that any of the "host" bits of  the
  11342.         network address can also be set. This allows you to disambiguate
  11343.         advertisements for networks having the  same  address  but  dif-
  11344.         ferent masks. Given an AS external link advertisement (or a sum-
  11345.         mary link advertisement), the described  network's  address  can
  11346.         now  be  obtained  by masking the Link State ID with the network
  11347.         mask carried in the body of the advertisement.  Again using  the
  11348.         above  example, the aggregate can now be advertised using a Link
  11349.         State ID of 192.9.4.0 and the single class C network  advertised
  11350.         simultaneously using the Link State ID of 192.9.4.255.
  11351.  
  11352.         Appendix F gives one possible algorithm for setting one or  more
  11353.         "host" bits in the Link State ID in order to disambiguate adver-
  11354.         tisements. It should be noted that this  is  a  local  decision.
  11355.         Each  router in an OSPF system is free to use its own algorithm,
  11356.         since only those advertisements originated by the router  itself
  11357.         are affected.
  11358.  
  11359.         It is believed that this change will be more or less  compatible
  11360.         with  implementations  of  RFC 1247. Implementations of RFC 1247
  11361.         will probably either a) install routing table entries that won't
  11362.         be used or b) do the correct processing as outlined in this memo
  11363.         or c) mark the advertisement as unusable when presented  with  a
  11364.         Link  State  ID  that  has  one  or  more  of the host bits set.
  11365.  
  11366.  
  11367.  
  11368. [Moy]                                                         [Page 203]
  11369.  
  11370. Internet Draft               OSPF Version 2                November 1992
  11371.  
  11372.  
  11373.         However, in the interest of interoperability implementations  of
  11374.         this  memo  should only set the host bits when absolutely neces-
  11375.         sary.
  11376.  
  11377.         The change affects Sections 12.1.4, 12.4.3, 12.4.5, 16.2,  16.3,
  11378.         16.4, 16.5, 16.6, A.4.4 and A.4.5.
  11379.  
  11380.     E.3 Obsoleting LSInfinity in router-LSAs
  11381.  
  11382.         The metric of LSInfinity can no longer be used in router-LSAs to
  11383.         indicate unusable links. This is being done for several reasons:
  11384.  
  11385.         First, it removes any possible confusion in an OSPF area  as  to
  11386.         just which routers/networks are reachable in the area. For exam-
  11387.         ple,  the  above  virtual  link  fix  relies  on  detecting  the
  11388.         existence  of  virtual links when running the Dijkstra. However,
  11389.         when one-directional links (i.e.,  cost  of  LSInfinity  in  one
  11390.         direction,  but  not  the  other) are possible, some routers may
  11391.         detect the existence of virtual links while others may not. This
  11392.         may defeat the fix for the virtual link problem.
  11393.  
  11394.         Second, it also helps the IP multicast extensions to  OSPF  (see
  11395.         [MOSPF]),  because  one-way reachability can lead to places that
  11396.         are reachable via unicast but not multicast, or vice versa.
  11397.  
  11398.         The two prior justifications for using LSInfinity in router-LSAs
  11399.         were  1) it was a way to not support TOS before TOS was optional
  11400.         and 2) it went along with strong TOS interpretations. These jus-
  11401.         tifications  are  no longer valid. However, LSInfinity will con-
  11402.         tinue to mean "unreachable"  in  summary-LSAs  and  AS-external-
  11403.         LSAs,  as some implementations use this as an alternative to the
  11404.         premature aging procedure specified in Section 14.1.
  11405.  
  11406.         This change has one other side effect. When two routers are con-
  11407.         nected  via  a  virtual  link  whose underlying path is non-TOS-
  11408.         capable, they must now revert to being  non-TOS-capable  routers
  11409.         themselves,  instead of the previous behavior of advertising the
  11410.         non-zero TOS costs of the virtual link as LSInfinity.  See  Sec-
  11411.         tion 15 for details.
  11412.  
  11413.     E.4 TOS encoding updated
  11414.  
  11415.         The encoding of TOS in OSPF link state advertisements  has  been
  11416.         updated  to  reflect  the new TOS value (minimize monetary cost)
  11417.         defined by [RFC 1349]. The OSPF encoding is defined  in  Section
  11418.         12.3,  which  is  identical  in  content  to Section A.5 of [RFC
  11419.         1349].
  11420.  
  11421.  
  11422.  
  11423.  
  11424. [Moy]                                                         [Page 204]
  11425.  
  11426. Internet Draft               OSPF Version 2                November 1992
  11427.  
  11428.  
  11429.     E.5 Summarizing routes into transit areas
  11430.  
  11431.         RFC 1247 mandated that routes associated with Area A  are  never
  11432.         summarized  back into Area A. However, this memo further reduces
  11433.         the number of summary links originated by refusing to  summarize
  11434.         into  Area  A those routes having next hops belonging to Area A.
  11435.         This is an optimization over  RFC  1247  behavior  when  virtual
  11436.         links  are  present.   For example, in the area configuration of
  11437.         Figure 6, Router RT11 need only originate a single summary  link
  11438.         having  the (collapsed) destination N9-N11,H1 into its connected
  11439.         transit area Area 2, since all of its other eligible routes have
  11440.         next  hops  belonging to Area 2 (and as such only need be adver-
  11441.         tised by other area border routers; in this case,  Routers  RT10
  11442.         and  RT7).  This  is the logical equivalent of a Distance Vector
  11443.         protocol's split horizon logic.
  11444.  
  11445.         This change appears in Section 12.4.3.
  11446.  
  11447.     E.6 Summarizing routes into stub areas
  11448.  
  11449.         RFC 1247 mandated that area  border  routers  attached  to  stub
  11450.         areas  must summarize all inter-area routes into the stub areas.
  11451.         However, while area border routers connected to OSPF stub  areas
  11452.         must  import default summary links into the stub area, they need
  11453.         not summarize other routes into the stub  area.  The  amount  of
  11454.         summarization done into stub areas can instead be put under con-
  11455.         figuration control. The network administrator can  then  make  a
  11456.         trade-off between optimal routing and database size.
  11457.  
  11458.         This change appears in Sections 12.4.3 and 12.4.4.
  11459.  
  11460.     E.7 Required Statistics appendix deleted
  11461.  
  11462.         Appendix D of RFC 1247,  which  specified  a  list  of  required
  11463.         statistics  for  an  OSPF implementation, has been deleted. That
  11464.         appendix has been superseded by the documents:  OSPF  Version  2
  11465.         Information  Base  [OSPF  MIB]  and  OSPF  Version 2 Traps [OSPF
  11466.         Traps].
  11467.  
  11468.     E.8 Other changes
  11469.  
  11470.         The following small changes were also made to RFC 1247:
  11471.  
  11472.         o   When  representing  unnumbered  point-to-point  networks  in
  11473.             router  links  advertisements,  the  corresponding Link Data
  11474.             field should be set to  the  unnumbered  interface's  MIB-II
  11475.             [RFC 1213] ifIndex value.
  11476.  
  11477.  
  11478.  
  11479.  
  11480. [Moy]                                                         [Page 205]
  11481.  
  11482. Internet Draft               OSPF Version 2                November 1992
  11483.  
  11484.  
  11485.         o   A comment was added to Step 3 of the Dijkstra  algorithm  in
  11486.             Section  16.1.  When  removing  vertices  from the candidate
  11487.             list, and when there is a choice of vertices closest to  the
  11488.             root, network vertices must be chosen before router vertices
  11489.             in order to necessarily find all equal-cost paths.
  11490.  
  11491.         o   A comment was added to Section 12.4.3 noting that a  summary
  11492.             link  advertisement  cannot  express a reachable destination
  11493.             whose path cost equals or exceeds LSInfinity.
  11494.  
  11495.         o   A comment was added to Section 15 noting that a virtual link
  11496.             whose  underlying  path  has  cost  greater than hexadecimal
  11497.             0xffff (the maximum size of an interface cost  in  a  router
  11498.             links advertisement) should be considered inoperational.
  11499.  
  11500.         o   An option was  added  to  the  definition  of  area  address
  11501.             ranges, allowing the network administrator to specify that a
  11502.             particular range should not  be  advertised  to  other  OSPF
  11503.             areas.  This enables the existence of certain networks to be
  11504.             hidden from other areas. This  change  appears  in  Sections
  11505.             12.4.3 and C.2.
  11506.  
  11507.         o   A note was added reminding implementors that bit E  (the  AS
  11508.             boundary  router indication) should never be set in a router
  11509.             links advertisement for a stub area, since stub areas cannot
  11510.             contain AS boundary routers.  This change appears in Section
  11511.             12.4.1.
  11512.  
  11513.  
  11514.  
  11515.  
  11516.  
  11517.  
  11518.  
  11519.  
  11520.  
  11521.  
  11522.  
  11523.  
  11524.  
  11525.  
  11526.  
  11527.  
  11528.  
  11529.  
  11530.  
  11531.  
  11532.  
  11533.  
  11534.  
  11535.  
  11536. [Moy]                                                         [Page 206]
  11537.  
  11538. Internet Draft               OSPF Version 2                November 1992
  11539.  
  11540.  
  11541. F. An algorithm for assigning Link State IDs
  11542.  
  11543.     In RFC 1247, the Link State ID in AS  external  link  advertisements
  11544.     and summary link advertisements is set to the described network's IP
  11545.     address. This memo relaxes that requirement, allowing one or more of
  11546.     the  network's host bits to be set in the Link State ID. This allows
  11547.     the router to originate separate advertisements for networks  having
  11548.     the  same addresses, yet different masks. Such networks can occur in
  11549.     the presence of supernetting and subnet 0s (see Section E.2 for more
  11550.     information).
  11551.  
  11552.     This appendix gives one possible algorithm for setting the host bits
  11553.     in Link State IDs.  The choice of such an algorithm is a local deci-
  11554.     sion. Separate routers are free to use different  algorithms,  since
  11555.     the only advertisements affected are the ones that the router itself
  11556.     originates.
  11557.  
  11558.     The algorithm below is stated for AS external  link  advertisements.
  11559.     This  is  only for clarity; the exact same algorithm can be used for
  11560.     summary links. Suppose that the router wishes  to  originate  an  AS
  11561.     external link advertisement for a network having address NA and mask
  11562.     NM1.  The  following  steps  are  then   used   to   determine   the
  11563.     advertisement's Link State ID:
  11564.  
  11565.     (1) Determine whether the router is already originating an AS exter-
  11566.         nal  link  advertisement  with  Link  State  ID equal to NA (the
  11567.         router itself of course will be listed  as  the  advertisement's
  11568.         Advertising  Router).  If not, set the Link State ID equal to NA
  11569.         (the RFC 1247 behavior) and the algorithm terminates. Otherwise,
  11570.  
  11571.     (2) Obtain the network mask from the body of the already existing AS
  11572.         external  link advertisement. Call this mask NM2. There are then
  11573.         two cases:
  11574.  
  11575.         o   NM1 is longer (i.e., more specific) than NM2. In this  case,
  11576.             set  the  Link  State  ID in the new advertisement to be the
  11577.             network [NA,NM1] with all the host bits set (i.e., equal  to
  11578.             NA or'ed together with all the bits that are not set in NM1,
  11579.             which is network [NA,NM1]'s broadcast address).
  11580.  
  11581.         o   NM2 is longer than NM1. In this case,  change  the  existing
  11582.             advertisement  (having Link State ID of NA) to reference the
  11583.             new network [NA,NM1] by incrementing  the  sequence  number,
  11584.             changing  the mask in the body to NM1 and using the cost for
  11585.             the new network. Then originate a new advertisement for  the
  11586.             old  network  [NA,NM2], with Link State ID equal to NA or'ed
  11587.             together with the bits that are not set in NM2  (i.e.,  net-
  11588.             work [NA,NM2]'s broadcast address).
  11589.  
  11590.  
  11591.  
  11592. [Moy]                                                         [Page 207]
  11593.  
  11594. Internet Draft               OSPF Version 2                November 1992
  11595.  
  11596.  
  11597.     The above algorithm assumes that  all  masks  are  contiguous;  this
  11598.     ensures  that  when  two networks have the same address, one mask is
  11599.     more specific than the other. The algorithm also assumes the no net-
  11600.     work  exists  having an address equal to another network's broadcast
  11601.     address. Given these two assumptions,  the  above  algorithm  always
  11602.     produces  unique  Link  State  IDs.  The above algorithm can also be
  11603.     reworded as follows: When original an AS external link state  adver-
  11604.     tisement,  try  to use network number as the Link State ID.  If that
  11605.     produces a conflict, examine the two networks in conflict. One  will
  11606.     be  a  subset  of  the other. For the less specific network, use the
  11607.     network number as the Link State ID and for the  more  specific  use
  11608.     its broadcast address instead (i.e., flip all the "host" bits to 1).
  11609.     In some cases (namely, the  most  specific  network  was  originated
  11610.     first), this will cause you to originate two LSAs at once.
  11611.  
  11612.     As an example of the algorithm, consider its operation  on  the  the
  11613.     following  sequence  of  events. In the following, 10.0 is shorthand
  11614.     for    [10.0.0.0,255.255.0.0],    10    is    a    shorthand     for
  11615.     [10.0.0.0,255.0.0.0], etc.
  11616.  
  11617.     (1) Want to originate an AS external link for 10.0.0
  11618.         Use a Link State ID of 10.0.0.0
  11619.  
  11620.     (2) Now want to originate an AS external link for 10.0
  11621.         Reoriginate 10.0.0 using a new Link State ID of 10.0.0.255
  11622.         Originate 10.0 with a Link State ID of 10.0.0.0
  11623.  
  11624.     (3) Now want to originate an AS external link for 10
  11625.         Reoriginate 10.0 as 10.0.255.255
  11626.         Originate 10 with a Link State ID of 10
  11627.         10.0.0 keeps its Link State ID of 10.0.0.255
  11628.  
  11629.  
  11630.  
  11631.  
  11632.  
  11633.  
  11634.  
  11635.  
  11636.  
  11637.  
  11638.  
  11639.  
  11640.  
  11641.  
  11642.  
  11643.  
  11644.  
  11645.  
  11646.  
  11647.  
  11648. [Moy]                                                         [Page 208]
  11649.  
  11650. Internet Draft               OSPF Version 2                November 1992
  11651.  
  11652.  
  11653. Security Considerations
  11654.  
  11655.     All OSPF protocol exchanges are authenticated. This is  accomplished
  11656.     through  authentication  fields contained in the OSPF packet header.
  11657.     For more information, see Sections 8.1, 8.2, and Appendix D.
  11658.  
  11659. Author's Address
  11660.  
  11661.     John Moy
  11662.     Proteon, Inc.
  11663.     9 Technology Drive
  11664.     Westborough, MA 01581
  11665.     Phone: (508) 898-2800
  11666.     Email: jmoy@proteon.com
  11667.  
  11668.     This document expires in April 1993.
  11669.  
  11670.  
  11671.  
  11672.  
  11673.  
  11674.  
  11675.  
  11676.  
  11677.  
  11678.  
  11679.  
  11680.  
  11681.  
  11682.  
  11683.  
  11684.  
  11685.  
  11686.  
  11687.  
  11688.  
  11689.  
  11690.  
  11691.  
  11692.  
  11693.  
  11694.  
  11695.  
  11696.  
  11697.  
  11698.  
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704. [Moy]                                                         [Page 209]
  11705.  
  11706.